aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2008-06-27 07:41:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-27 08:31:44 -0400
commitcd80917e4ff465ea77106f8e4fb631eedc4cf426 (patch)
tree0b12aed9293c8b0683e7f74d5d111f5d436fa017 /kernel/sched.c
parent93b75217df39e6d75889cc6f8050343286aff4a5 (diff)
sched: fix shares boost logic
In case the domain is empty, pretend there is a single task on each cpu, so that together with the boost logic we end up giving 1/n shares to each cpu. Signed-off-by: Peter Zijlstra <peterz@infradead.org> 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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 6c5eb3bc37e0..1cff969f6646 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1549,6 +1549,9 @@ tg_shares_up(struct task_group *tg, int cpu, struct sched_domain *sd)
1549 if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE)) 1549 if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE))
1550 shares = tg->shares; 1550 shares = tg->shares;
1551 1551
1552 if (!rq_weight)
1553 rq_weight = cpus_weight(sd->span) * NICE_0_LOAD;
1554
1552 for_each_cpu_mask(i, sd->span) { 1555 for_each_cpu_mask(i, sd->span) {
1553 struct rq *rq = cpu_rq(i); 1556 struct rq *rq = cpu_rq(i);
1554 unsigned long flags; 1557 unsigned long flags;