Re: [PATCH] sched: fair-group: fix a Div0 error of the fair groupscheduler

From: Peter Zijlstra
Date: Mon Apr 28 2008 - 04:34:03 EST


On Mon, 2008-04-28 at 16:27 +0800, Miao Xie wrote:

> I'm sorry, I didn't explained clearly.Though echoing ULONG_MAX value into
> cpu.shares causes Div0 error, this error was not caused by the above code.
> It is caused by the following code.
>
> calc_delta_mine()
> ->lw->inv_weight = (WMULT_CONST-lw->weight/2) / (lw->weight+1);
>
> And besides, the Div0 error caused by echoing ULONG_MAX occured on the UP system
> or on SMP system with only one cpu.
>
> So this patch fixes the bug caused by echoing a number which was less than the number
> of processores into the "cpu.shares" file, but doesn't fix the bug caused by echoing
> ULONG_MAX.

Ah, ok. But I guess we run into other problems with weights that heavy,
but we should not crash.

Ok, I'll ACK your initial patch

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