Kaynağa Gözat

sched: fix calc_delta_mine()

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>
Ingo Molnar 17 yıl önce
ebeveyn
işleme
27d1172660
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      kernel/sched.c

+ 1 - 1
kernel/sched.c

@@ -1084,7 +1084,7 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight,
 	u64 tmp;
 	u64 tmp;
 
 
 	if (unlikely(!lw->inv_weight))
 	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;
 	tmp = (u64)delta_exec * weight;
 	/*
 	/*