]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
sched: fix shares boost logic
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 27 Jun 2008 11:41:34 +0000 (13:41 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 27 Jun 2008 12:31:44 +0000 (14:31 +0200)
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>
kernel/sched.c

index 6c5eb3bc37e0c0ab69fc5ba53d2293ca5a3ede52..1cff969f66463e8505386d4b4e5287bd852252ba 100644 (file)
@@ -1549,6 +1549,9 @@ tg_shares_up(struct task_group *tg, int cpu, struct sched_domain *sd)
        if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE))
                shares = tg->shares;
 
+       if (!rq_weight)
+               rq_weight = cpus_weight(sd->span) * NICE_0_LOAD;
+
        for_each_cpu_mask(i, sd->span) {
                struct rq *rq = cpu_rq(i);
                unsigned long flags;