From: keith mannthey Date: Mon, 25 Sep 2006 23:25:35 +0000 (-0700) Subject: [PATCH] i386: fix flat mode numa on a real numa system X-Git-Tag: v2.6.19-rc1~1236 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=bfa0e9a07cd31f3858239dbc93011b82780acf4b [PATCH] i386: fix flat mode numa on a real numa system If there is only 1 node in the system cpus should think they are apart of some other node. If cases where a real numa system boots the Flat numa option make sure the cpus don't claim to be apart on a non-existent node. Signed-off-by: Keith Mannthey Cc: Andy Whitcroft Cc: Dave Hansen Cc: Andi Kleen Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index f948419..efe0799 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -642,9 +642,13 @@ static void map_cpu_to_logical_apicid(void) { int cpu = smp_processor_id(); int apicid = logical_smp_processor_id(); + int node = apicid_to_node(apicid); + + if (!node_online(node)) + node = first_online_node; cpu_2_logical_apicid[cpu] = apicid; - map_cpu_to_node(cpu, apicid_to_node(apicid)); + map_cpu_to_node(cpu, node); } static void unmap_cpu_to_logical_apicid(int cpu)