aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 6c1ecbdc0db9..eaf6751e7612 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1340,8 +1340,13 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight,
1340{ 1340{
1341 u64 tmp; 1341 u64 tmp;
1342 1342
1343 if (!lw->inv_weight) 1343 if (!lw->inv_weight) {
1344 lw->inv_weight = 1 + (WMULT_CONST-lw->weight/2)/(lw->weight+1); 1344 if (BITS_PER_LONG > 32 && unlikely(lw->weight >= WMULT_CONST))
1345 lw->inv_weight = 1;
1346 else
1347 lw->inv_weight = 1 + (WMULT_CONST-lw->weight/2)
1348 / (lw->weight+1);
1349 }
1345 1350
1346 tmp = (u64)delta_exec * weight; 1351 tmp = (u64)delta_exec * weight;
1347 /* 1352 /*