[PATCH 16/30] sched: fix sched_balance_self() smp group balancing

Peter Zijlstra
2008-06-27T12:09:38Z

[-- Attachment #1: sched-fix-sched_balance_self.patch --]
[-- Type: text/plain, Size: 555 bytes --]

Finding the least idle cpu is more accurate when done with updated shares.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/sched.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -2171,6 +2171,9 @@ static int sched_balance_self(int cpu, i
sd = tmp;
}

+ if (sd)
+ update_shares(sd);
+
while (sd) {
cpumask_t span, tmpmask;
struct sched_group *group;

--