Re: Workaround for wrapping loadaverage

From: Andrew Morton
Date: Mon Nov 08 2004 - 04:38:34 EST


Patrick Mau <mau@xxxxxxxxxxxxx> wrote:
>
> n a previous message archived at
>
> http://www.ussg.iu.edu/hypermail/linux/kernel/0410.2/2950.html
>
> I described a problem with a wrapping load average on my SMP system.
> The following small userspace load simulation exactly matches the
> numbers I am seeing.
>
> We can only account for 1024 runnable processes, since we have 22 bits
> precision, I would like to suggest a patch to calc_load in kernel/timer.c
> that would limit the number of active tasks:
>
>
> if (active_tasks > 1024 * FIXED_1)
> active_tasks = 1024 * FIXED_1;
>

It's better than wrapping to zero...

Why do we need 11 bits after the binary point?
-
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/