Skip to contentSkip to conversation

tasks cannot run on cpus onlined after boot

PATCH In review Nathan Lynch 2 participants 2 messages Jan 7, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tasks cannot run on cpus onlined after boot

Commit 5c1e176781f43bc902a51e5832f789756bff911b ("sched: force /sbin/init off isolated cpus") sets init's cpus_allowed to a subset of cpu_online_map at boot time, which means that tasks won't be scheduled on cpus that are added to the system later.

Make init's cpus_allowed a subset of cpu_possible_map instead. This should still preserve the behavior that Nick's change intended.

Thanks to Giuliano Pochini for reporting this and testing the fix:

http://ozlabs.org/pipermail/linuxppc-dev/2006-December/029397.html

---

This is a regression from 2.6.18. Assuming this change is okay, this should go to -stable for 2.6.19.x.

kernel/sched.c +1 -1
index b515e3c..3c8b1c5 100644
@@ -6875,7 +6875,7 @@ void __init sched_init_smp(void)
 
 	lock_cpu_hotplug();
 	arch_init_sched_domains(&cpu_online_map);
-	cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map);
+	cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
 	if (cpus_empty(non_isolated_cpus))
 		cpu_set(smp_processor_id(), non_isolated_cpus);
 	unlock_cpu_hotplug();
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Nathan Lynch

Commit 5c1e176781f43bc902a51e5832f789756bff911b ("sched: force /sbin/init off isolated cpus") sets init's cpus_allowed to a subset of cpu_online_map at boot time, which means that tasks won't be scheduled on cpus that are added to the system later.

Quoted 8 lines

Make init's cpus_allowed a subset of cpu_possible_map instead. This should still preserve the behavior that Nick's change intended.

Thanks to Giuliano Pochini for reporting this and testing the fix:

http://ozlabs.org/pipermail/linuxppc-dev/2006-December/029397.html

nicely spotted!

kernel/sched.c void __init sched_init_smp(void) · line 6878

Quoted 2 lines
kernel/sched.c +1 -1
-	cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map);
+	cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);

Ingo