diff options
author | Andrew Morton <akpm@osdl.org> | 2004-05-09 23:27:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-09 23:27:02 -0700 |
commit | a65fb1d0fdf4493d184ca6d73372e288ba3afc27 (patch) | |
tree | e365701d3ed17edc246c73d6902f9f8123544c60 /kernel | |
parent | fd7b7b0f905b4123252d5d791f27b86d97258434 (diff) | |
download | history-a65fb1d0fdf4493d184ca6d73372e288ba3afc27.tar.gz |
[PATCH] sched: oops fix
From: Nick Piggin <nickpiggin@yahoo.com.au>
After the for_each_domain change, the warn here won't trigger, instead it
will oops in the if statement. Also, make sure we don't pass an empty
cpumask to for_each_cpu.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 480dcaf6f716da..fedffbda6b1e1c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1694,8 +1694,7 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu) if (cpu_isset(busiest->push_cpu, sd->span)) break; } - - if (!sd->parent && !cpu_isset(busiest->push_cpu, sd->span)) { + if (!sd) { WARN_ON(1); return; } @@ -1709,20 +1708,20 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu) do { cpumask_t tmp; runqueue_t *rq; - int push_cpu = 0, nr = 0; + int push_cpu = 0; if (group == busy_group) goto next_group; cpus_and(tmp, group->cpumask, cpu_online_map); + if (cpus_weight(tmp) == 0) + goto next_group; + for_each_cpu_mask(i, tmp) { if (!idle_cpu(i)) goto next_group; push_cpu = i; - nr++; } - if (nr == 0) - goto next_group; rq = cpu_rq(push_cpu); double_lock_balance(busiest, rq); |