From: Ingo Molnar Date: Fri, 14 Mar 2008 21:20:01 +0000 (+0100) Subject: sched: fix calc_delta_mine() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27d117266097101dcf79c4576903cdcdd0eabffc;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 3a4ba3dc0f49..6b06f23261c0 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; /*