lkml.org 
[lkml]   [2018]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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!

\
 
 \ /
  Last update: 2018-08-06 18:05    [W:0.057 / U:2.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site