lkml.org 
[lkml]   [2018]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 10/10] psi: aggregate ongoing stall events when somebody reads pressure
On Thu, Jul 12, 2018 at 01:29:42PM -0400, Johannes Weiner wrote:
> @@ -218,10 +216,36 @@ static bool psi_update_stats(struct psi_group *group)
> for_each_online_cpu(cpu) {
> struct psi_group_cpu *groupc = per_cpu_ptr(group->cpus, cpu);
> unsigned long nonidle;
> + struct rq_flags rf;
> + struct rq *rq;
> + u64 now;
>
> - if (!groupc->nonidle_time)
> + if (!groupc->nonidle_time && !groupc->nonidle)
> continue;
>
> + /*
> + * We come here for two things: 1) periodic per-cpu
> + * bucket flushing and averaging and 2) when the user
> + * wants to read a pressure file. For flushing and
> + * averaging, which is relatively infrequent, we can
> + * be lazy and tolerate some raciness with concurrent
> + * updates to the per-cpu counters. However, if a user
> + * polls the pressure state, we want to give them the
> + * most uptodate information we have, including any
> + * currently active state which hasn't been timed yet,
> + * because in case of an iowait or a reclaim run, that
> + * can be significant.
> + */
> + if (ondemand) {
> + rq = cpu_rq(cpu);
> + rq_lock_irq(rq, &rf);

That's a DoS right there..

\
 
 \ /
  Last update: 2018-07-17 17:14    [W:0.407 / U:1.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site