<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;

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-05 18:45:28.101939424 -0700
+++ 25-akpm/kernel/sched.c	2004-04-05 18:45:28.107938512 -0700
@@ -1693,8 +1693,7 @@ static void active_load_balance(runqueue
 		if (cpu_isset(busiest-&gt;push_cpu, sd-&gt;span))
 			break;
 	}
-
-	if (!sd-&gt;parent &amp;&amp; !cpu_isset(busiest-&gt;push_cpu, sd-&gt;span)) {
+	if (!sd) {
 		WARN_ON(1);
 		return;
 	}
@@ -1708,20 +1707,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-&gt;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);

_
</pre></body></html>