[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180806160329.GP2494@hirez.programming.kicks-ass.net>
Date: Mon, 6 Aug 2018 18:03:29 +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>,
Daniel Drake <drake@...lessm.com>,
Vinayak Menon <vinmenon@...eaurora.org>,
Christopher Lameter <cl@...ux.com>,
Mike Galbraith <efault@....de>,
Shakeel Butt <shakeelb@...gle.com>,
Peter Enderborg <peter.enderborg@...y.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...com
Subject: Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and
IO
On Mon, Aug 06, 2018 at 11:19:28AM -0400, Johannes Weiner wrote:
> On Fri, Aug 03, 2018 at 06:56:41PM +0200, Peter Zijlstra wrote:
> > On Wed, Aug 01, 2018 at 11:19:57AM -0400, Johannes Weiner wrote:
> > > + u32 uninitialized_var(nonidle);
> >
> > urgh.. I can see why the compiler got confused. Dodgy :-)
>
> :-) I think we can make this cleaner. Something like this (modulo the
> READ_ONCE/WRITE_ONCE you pointed out in the other email)?
>
> @@ -244,60 +287,17 @@ static bool psi_update_stats(struct psi_group *group)
> */
> for_each_online_cpu(cpu) {
> struct psi_group_cpu *groupc = per_cpu_ptr(group->pcpu, cpu);
> + u32 nonidle;
> +
> + nonidle = read_update_delta(groupc, PSI_NONIDLE, cpu);
> + nonidle = nsecs_to_jiffies(nonidle);
> + nonidle_total += nonidle;
> +
> + for (s = 0; s < PSI_NONIDLE; s++) {
> + u32 delta;
> +
> + delta = read_update_delta(groupc, s, cpu);
> + deltas[s] += (u64)delta * nonidle;
> }
> }
Yes, much clearer, thanks!
Powered by blists - more mailing lists