From: Ingo Molnar Date: Fri, 14 Mar 2008 21:20:01 +0000 (+0100) Subject: sched: fix calc_delta_mine() X-Git-Tag: v2.6.25-rc6~8 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=27d117266097101dcf79c4576903cdcdd0eabffc;p=linux-2.6-omap-h63xx.git sched: fix calc_delta_mine() lw->weight can be 0 for a short time during bootup. Signed-off-by: Ingo Molnar Signed-off-by: Peter Zijlstra --- diff --git a/kernel/sched.c b/kernel/sched.c index 3a4ba3dc0f4..6b06f23261c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1084,7 +1084,7 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight, u64 tmp; if (unlikely(!lw->inv_weight)) - lw->inv_weight = (WMULT_CONST - lw->weight/2) / lw->weight + 1; + lw->inv_weight = (WMULT_CONST-lw->weight/2) / (lw->weight+1); tmp = (u64)delta_exec * weight; /*