From: Nick Piggin 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. --- 25-akpm/kernel/sched.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff -puN kernel/sched.c~sched-fix-activelb kernel/sched.c --- 25/kernel/sched.c~sched-fix-activelb 2004-04-02 12:16:13.418497256 -0800 +++ 25-akpm/kernel/sched.c 2004-04-02 12:16:13.424496344 -0800 @@ -1692,8 +1692,7 @@ static void active_load_balance(runqueue 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; } @@ -1707,20 +1706,20 @@ static void active_load_balance(runqueue 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); _