Commit a65fb1d0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent fd7b7b0f
...@@ -1694,8 +1694,7 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu) ...@@ -1694,8 +1694,7 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu)
if (cpu_isset(busiest->push_cpu, sd->span)) if (cpu_isset(busiest->push_cpu, sd->span))
break; break;
} }
if (!sd) {
if (!sd->parent && !cpu_isset(busiest->push_cpu, sd->span)) {
WARN_ON(1); WARN_ON(1);
return; return;
} }
...@@ -1709,20 +1708,20 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu) ...@@ -1709,20 +1708,20 @@ static void active_load_balance(runqueue_t *busiest, int busiest_cpu)
do { do {
cpumask_t tmp; cpumask_t tmp;
runqueue_t *rq; runqueue_t *rq;
int push_cpu = 0, nr = 0; int push_cpu = 0;
if (group == busy_group) if (group == busy_group)
goto next_group; goto next_group;
cpus_and(tmp, group->cpumask, cpu_online_map); cpus_and(tmp, group->cpumask, cpu_online_map);
if (cpus_weight(tmp) == 0)
goto next_group;
for_each_cpu_mask(i, tmp) { for_each_cpu_mask(i, tmp) {
if (!idle_cpu(i)) if (!idle_cpu(i))
goto next_group; goto next_group;
push_cpu = i; push_cpu = i;
nr++;
} }
if (nr == 0)
goto next_group;
rq = cpu_rq(push_cpu); rq = cpu_rq(push_cpu);
double_lock_balance(busiest, rq); double_lock_balance(busiest, rq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment