[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180717151336.GZ2476@hirez.programming.kicks-ass.net>
Date: Tue, 17 Jul 2018 17:13:36 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Vinayak Menon <vinmenon@...eaurora.org>,
Christopher Lameter <cl@...ux.com>,
Mike Galbraith <efault@....de>,
Shakeel Butt <shakeelb@...gle.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...com
Subject: Re: [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..
Powered by blists - more mailing lists