Skip to content

Commit

Permalink
sched: fix calc_delta_mine()
Browse files Browse the repository at this point in the history
lw->weight can be 0 for a short time during bootup.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
  • Loading branch information
Ingo Molnar committed Mar 15, 2008
1 parent e89996a commit 27d1172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched.c
Expand Up @@ -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;
/*
Expand Down

0 comments on commit 27d1172

Please sign in to comment.