Re: load average wraps at 1024

From: Nish Aravamudan
Date: Wed Jan 11 2006 - 18:00:08 EST


On 1/11/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
> Hi,
>
> Don't know if this is a kernel issue or userspace issue, but load
> average values wrap back to 0 once they hit 1024.
>
> I've been trying to stress 2.6.15-mm3 by putting a *lot* of load on it
> and seeing if it stays alive, how it copes, how long it seems to take
> to recover etc.
> While doing that I've done some test runs that start thousands of
> processes and the load average quickly shoots up to several hundred
> and eventually reach 1000 - when it continues to climb it goes to 1023
> and then wraps down to small numbers like 4-5 and then continue
> climbing from there. Once I kill all my processes it slowly goes down
> to zero, then wraps back to ~1000 and continues to climb down from
> there until it's eventually back to normal.
>
> Is this expected behaviour?

I'm going to say yes, based on the comments in sched.h:

/*
* These are the constant used to fake the fixed-point load-average
* counting. Some notes:
* - 11 bit fractions expand to 22 bits by the multiplies: this gives
* a load-average precision of 10 bits integer + 11 bits fractional
* - if you want to count load-averages more often, you need more
* precision, or rounding will get you. With 2-second counting freq,
* the EXP_n values would be 1981, 2034 and 2043 if still using only
* 11 bit fractions.
*/

That is, 10 bits of integer is 1024, the remaining 11 bits being used
for fractions.

Thanks,
Nish
-
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/