Re: PROBLEM: high load average when idle

Anders Boström
2007-10-03T20:15:53Z

>>>>> "LT" == Linus Torvalds <torvalds@linux-foundation.org> writes:

LT> On Wed, 3 Oct 2007, Chuck Ebbert wrote:
>>
>> But we reduce the number of samples because some ticks just never
>> happen when the timers get rounded:
>>
>> No rounding:
>>
>> tick ............... tick
>> 1 running 1 running
>>
>> Rounded:
>>
>> tick
>> 2 running
>>
>> In the first case the average is 1, but it's 2 in the second.

LT> In fact, I think this is it!

LT> The load average is not calculated every tick, because that's not just
LT> expensive, but we also want to have some time-based decay. So it's
LT> calculated every LOAD_FREQ ticks.

LT> And guess what: LOAD_FREQ is defined to be exactly five seconds.

LT> So imagine if the timer gets to be in sync with another event that happens
LT> every five seconds - let's pick at random a 5-second JBD transaction
LT> thing?

LT> Anders - does this idiotic patch make a difference for you?

Yes, it does, it fixes the load average!!! I guess we have something
here!

Why does this problem only show up on my computer? Any idea?

/ Anders

LT> Without this, I can easily imagine that the rounding code tends to try to
LT> round to an even second, and the load-average code generally also runs at
LT> even seconds!

LT> Linus

LT> ---
LT> include/linux/sched.h | 2 +-
LT> 1 files changed, 1 insertions(+), 1 deletions(-)

LT> diff --git a/include/linux/sched.h b/include/linux/sched.h
LT> index a01ac6d..643de0f 100644
LT> --- a/include/linux/sched.h
LT> +++ b/include/linux/sched.h
LT> @@ -113,7 +113,7 @@ extern unsigned long avenrun[]; /* Load averages */

LT> #define FSHIFT 11 /* nr of bits of precision */