mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i386 !NUMA node_to_cpumask broken in early boot
@ 2005-08-19  2:07 Zwane Mwaikambo
  2005-08-19  2:12 ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Zwane Mwaikambo @ 2005-08-19  2:07 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Andi Kleen, Andrew Morton

node_to_cpumask on non NUMA systems is broken if used before all the 
processors have been brought up as it returns cpu_online_map, as opposed 
to NUMA i386 systems which does it earlier than AP bringup. So return 
which processors responded via cpu_present_map and switch to 
cpu_online_map during normal runtime. This was found whilst testing a 
patch which does node dependent work before APs have all gone online.

Signed-off-by: Zwane Mwaikambo <zwane@arm.linux.org.uk>

Index: linux-2.6.13-rc5-mm1/include/asm-i386/topology.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.13-rc5-mm1/include/asm-i386/topology.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 topology.h
--- linux-2.6.13-rc5-mm1/include/asm-i386/topology.h	7 Aug 2005 21:38:36 -0000	1.1.1.1
+++ linux-2.6.13-rc5-mm1/include/asm-i386/topology.h	19 Aug 2005 01:35:07 -0000
@@ -99,6 +99,15 @@ extern unsigned long node_remap_size[];
  * above macros here.
  */
 
+#define node_to_cpumask(node)	_node_to_cpumask(node)
+static inline cpumask_t _node_to_cpumask(int node)
+{
+	if (unlikely(system_state == SYSTEM_BOOTING))
+		return cpu_present_map;
+
+	return cpu_online_map;
+}
+
 #include <asm-generic/topology.h>
 
 #endif /* CONFIG_NUMA */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-19  3:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19  2:07 [PATCH] i386 !NUMA node_to_cpumask broken in early boot Zwane Mwaikambo
2005-08-19  2:12 ` Andi Kleen
2005-08-19  2:49   ` Zwane Mwaikambo
2005-08-19  3:06     ` Andi Kleen
2005-08-19  3:27       ` Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®