Re: [PATCH v2 08/11] sched: get CPU's activity statistic

From: Peter Zijlstra
Date: Wed May 28 2014 - 11:17:44 EST


On Wed, May 28, 2014 at 01:10:01PM +0100, Morten Rasmussen wrote:
> The basic problem is that worst case: sum starting from 0 and period
> already at LOAD_AVG_MAX = 47742, it takes LOAD_AVG_MAX_N = 345 periods
> (ms) for sum to reach 47742.

But it takes only 4 periods (4*32ms) to get ~94% of the way there,

So our half-time is 32 * 1024 ms, now look at \Sum_i=1,4 1/(2^i) =
0.9375. So 4 periods (4*32*1024=131072 ms) gets us ~94% of the way
there.

Now, granted, 4 periods of 32-ish ms is still very long, but nowhere
near as horrid as the full convergence.

Attachment: pgpZpnRbbbAEh.pgp
Description: PGP signature