Re: [PATCH] sched: Avoid side-effect of tickless idle on update_cpu_load (v2)

From: Peter Zijlstra
Date: Tue May 18 2010 - 11:12:34 EST


On Mon, 2010-05-17 at 10:52 -0700, Venkatesh Pallipadi wrote:
> > load_i = ((2^i)-1)/(2^i) * load_i + 1/(2^i) * load_(i-1)
> >
> > not
> >
> > load_i = ((2^i)-1)/(2^i) * load_i + 1/(2^i) * cur_load
>
> Hmm. I assumed you meant
> load_(i-1) is same as cur_load when you said
> >> >Where load_-1 == current load.
>
> No? Or did I miss something?

load_(i-1) is only load_-1 when i == 0.

But it seems you're right and I misread the code. update_cpu_load() does
take a copy of this_load for each iteration, initially I thought it used
the load of the last iteration.

> For the updates done every tick, it is
> load = degrade * load + (1-degrade) * cur_load
> For updates done with missed ticks
> load = degrade^(missed-1) * load
> load = degrade * load + (1-degrade) * cur_load
>
> So, cur_load is only accounted for the last tick, and zero load
> assumed for all the missed ticks.

Right.
--
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/