sched: fix calc_delta_asym, #2
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 27 Jun 2008 11:41:13 +0000 (13:41 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 27 Jun 2008 12:31:28 +0000 (14:31 +0200)
Ok, so why are we in this mess, it was:

  1/w

but now we mixed that rw in the mix like:

 rw/w

rw being \Sum w suggests: fiddling w, we should also fiddle rw, humm?

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index 2268e634812b701002d16d2e222da8586960ba57..2e197b8e43f1807d6358ae48a8b5fbe7e94c346e 100644 (file)
@@ -429,6 +429,7 @@ calc_delta_asym(unsigned long delta, struct sched_entity *se)
 
        for_each_sched_entity(se) {
                struct load_weight *se_lw = &se->load;
+               unsigned long rw = cfs_rq_of(se)->load.weight;
 
 #ifdef CONFIG_FAIR_SCHED_GROUP
                struct cfs_rq *cfs_rq = se->my_q;
@@ -450,14 +451,16 @@ calc_delta_asym(unsigned long delta, struct sched_entity *se)
                        lw.inv_weight = 0;
 
                        se_lw = &lw;
+                       rw += lw.weight - se->load.weight;
                } else
 #endif
 
-               if (se->load.weight < NICE_0_LOAD)
+               if (se->load.weight < NICE_0_LOAD) {
                        se_lw = &lw;
+                       rw += NICE_0_LOAD - se->load.weight;
+               }
 
-               delta = calc_delta_mine(delta,
-                               cfs_rq_of(se)->load.weight, se_lw);
+               delta = calc_delta_mine(delta, rw, se_lw);
        }
 
        return delta;