RE: [PATCH] sched: Folding nohz load accounting more accurate

From: Peter Zijlstra
Date: Wed Jun 20 2012 - 05:45:37 EST


On Tue, 2012-06-19 at 08:50 -0700, Doug Smythies wrote:
> My automated 63 hour test has been terminated, the code changed
> and the test re-started.

There's another boo-boo in there:


> @@ -2369,11 +2493,35 @@ void get_avenrun(unsigned long *loads, unsigned long offset, int shift)
> */
> void calc_global_load(unsigned long ticks)
> {
> - long active;
> + long active, delta;
>
> if (time_before(jiffies, calc_load_update + 10))
> return;
>
> + /*
> + * Fold the 'old' idle-delta to include all NO_HZ cpus.
> + *
> + * cpu0 cpu1 cpu2 ..
> + *
> + * >--- [sample A]
> + *
> + * -> NOHZ
> + * -> NOHZ
> + * ->NOHZ
> + *
> + * >--- [sample B]
> + *
> + * >--- [sample C]
> + *
> + * NOHZ-> (here)
> + *
> + * Since all CPUs went into NOHZ state, all 'missed' samples (B, C)
> + * should include the folded idle-delta.
> + */
> + delta += calc_load_fold_idle();

This gives a gcc warning about use without init, which is true, that should be:

delta = calc_load_fold_idle();

> + if (delta)
> + atomic_long_add(delta, &calc_load_tasks);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/