summaryrefslogtreecommitdiff
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-06-27 13:41:24 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-27 14:31:37 +0200
commit3e5459b4bea3ca2618cc02d56d12639f2cba531d (patch)
treebf931bd0cb3f653a62045c99beaed837242dd773 /kernel/sched.c
parentc8cba857b4997d5b00451d01474638f6a153f713 (diff)
downloadlwn-3e5459b4bea3ca2618cc02d56d12639f2cba531d.tar.gz
lwn-3e5459b4bea3ca2618cc02d56d12639f2cba531d.zip
sched: fix newidle smp group balancing
Re-compute the shares on newidle - so we can make a decision based on recent data. 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>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f864b751fd19..cdd09462fc98 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1579,6 +1579,13 @@ static void update_shares(struct sched_domain *sd)
walk_tg_tree(tg_nop, tg_shares_up, 0, sd);
}
+static void update_shares_locked(struct rq *rq, struct sched_domain *sd)
+{
+ spin_unlock(&rq->lock);
+ update_shares(sd);
+ spin_lock(&rq->lock);
+}
+
static void update_h_load(int cpu)
{
walk_tg_tree(tg_load_down, tg_nop, cpu, NULL);
@@ -1595,6 +1602,10 @@ static inline void update_shares(struct sched_domain *sd)
{
}
+static inline void update_shares_locked(struct rq *rq, struct sched_domain *sd)
+{
+}
+
#endif
#endif
@@ -3543,6 +3554,7 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd,
schedstat_inc(sd, lb_count[CPU_NEWLY_IDLE]);
redo:
+ update_shares_locked(this_rq, sd);
group = find_busiest_group(sd, this_cpu, &imbalance, CPU_NEWLY_IDLE,
&sd_idle, cpus, NULL);
if (!group) {
@@ -3586,6 +3598,7 @@ redo:
} else
sd->nr_balance_failed = 0;
+ update_shares_locked(this_rq, sd);
return ld_moved;
out_balanced: