[PATCH 04/30] sched: fix calc_delta_asym

Peter Zijlstra
2008-06-27T11:59:08Z

[-- Attachment #1: sched-fiddle-asym.patch --]
[-- Type: text/plain, Size: 1206 bytes --]

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>
---
kernel/sched_fair.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6/kernel/sched_fair.c
===================================================================
--- linux-2.6.orig/kernel/sched_fair.c
+++ linux-2.6/kernel/sched_fair.c
@@ -432,6 +432,7 @@ calc_delta_asym(unsigned long delta, str

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;
@@ -453,14 +454,16 @@ calc_delta_asym(unsigned long delta, str
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;

--