- convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     convert i386 Summit subarch to use SRAT info for apicid_to_node calls

has been removed from the -mm tree.  Its filename is

     convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: convert i386 Summit subarch to use SRAT info for apicid_to_node calls
From: keith mannthey <kmannth@xxxxxxxxxx>

Convert the i386 summit subarch apicid_to_node to use node information
provided by the SRAT.  It was discussed a little on LKML a few weeks ago
and was seen as an acceptable fix.  The current way of obtaining the nodeid

 static inline int apicid_to_node(int logical_apicid)
 {
   return logical_apicid >> 5;
 }

is just not correct for all summit systems/bios.  Assuming the apicid
matches the Linux node number require a leap of faith that the bios mapped
out the apicids a set way.  Modern summit HW (IBM x460) does not layout its
bios in the manner for various reasons and is unable to boot i386 numa.

The best way to get the correct apicid to node information is from the SRAT
table during boot.  It lays out what apicid belongs to what node.  I use
this information to create a table for use at run time.

Signed-off-by: Keith Mannthey <kmannth@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/smpboot.c               |    5 ++++-
 arch/i386/kernel/srat.c                  |    7 +++++++
 include/asm-i386/mach-summit/mach_apic.h |    2 +-
 include/asm-i386/smp.h                   |    2 ++
 4 files changed, 14 insertions(+), 2 deletions(-)

diff -puN arch/i386/kernel/smpboot.c~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls
+++ a/arch/i386/kernel/smpboot.c
@@ -102,6 +102,8 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mos
 			{ [0 ... NR_CPUS-1] = 0xff };
 EXPORT_SYMBOL(x86_cpu_to_apicid);
 
+u8 apicid_2_node[MAX_APICID];
+
 /*
  * Trampoline 80x86 program as an array.
  */
@@ -645,7 +647,7 @@ static void map_cpu_to_logical_apicid(vo
 {
 	int cpu = smp_processor_id();
 	int apicid = logical_smp_processor_id();
-	int node = apicid_to_node(apicid);
+	int node = apicid_to_node(hard_smp_processor_id());
 
 	if (!node_online(node))
 		node = first_online_node;
@@ -954,6 +956,7 @@ static int __devinit do_boot_cpu(int api
 
 	irq_ctx_init(cpu);
 
+	x86_cpu_to_apicid[cpu] = apicid;
 	/*
 	 * This grunge runs the startup process for
 	 * the targeted processor.
diff -puN arch/i386/kernel/srat.c~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls arch/i386/kernel/srat.c
--- a/arch/i386/kernel/srat.c~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls
+++ a/arch/i386/kernel/srat.c
@@ -30,6 +30,7 @@
 #include <linux/nodemask.h>
 #include <asm/srat.h>
 #include <asm/topology.h>
+#include <asm/smp.h>
 
 /*
  * proximity macros and definitions
@@ -54,6 +55,7 @@ struct node_memory_chunk_s {
 static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS];
 
 static int num_memory_chunks;		/* total number of memory chunks */
+static u8 __initdata apicid_to_pxm[MAX_APICID];
 
 extern void * boot_ioremap(unsigned long, unsigned long);
 
@@ -69,6 +71,8 @@ static void __init parse_cpu_affinity_st
 	/* mark this node as "seen" in node bitmap */
 	BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain);
 
+	apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain;
+
 	printk("CPU 0x%02X in proximity domain 0x%02X\n",
 		cpu_affinity->apic_id, cpu_affinity->proximity_domain);
 }
@@ -235,6 +239,9 @@ static int __init acpi20_parse_srat(stru
 	printk("Number of logical nodes in system = %d\n", num_online_nodes());
 	printk("Number of memory chunks in system = %d\n", num_memory_chunks);
 
+	for (i = 0; i < MAX_APICID; i++)
+		apicid_2_node[i] = pxm_to_node(apicid_to_pxm[i]);
+
 	for (j = 0; j < num_memory_chunks; j++){
 		struct node_memory_chunk_s * chunk = &node_memory_chunk[j];
 		printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n",
diff -puN include/asm-i386/mach-summit/mach_apic.h~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls include/asm-i386/mach-summit/mach_apic.h
--- a/include/asm-i386/mach-summit/mach_apic.h~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls
+++ a/include/asm-i386/mach-summit/mach_apic.h
@@ -88,7 +88,7 @@ static inline void clustered_apic_check(
 
 static inline int apicid_to_node(int logical_apicid)
 {
-	return logical_apicid >> 5;          /* 2 clusterids per CEC */
+	return apicid_2_node[logical_apicid];
 }
 
 /* Mapping from cpu number to logical apicid */
diff -puN include/asm-i386/smp.h~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls include/asm-i386/smp.h
--- a/include/asm-i386/smp.h~convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls
+++ a/include/asm-i386/smp.h
@@ -46,6 +46,8 @@ extern u8 x86_cpu_to_apicid[];
 
 #define cpu_physical_id(cpu)	x86_cpu_to_apicid[cpu]
 
+extern u8 apicid_2_node[];
+
 #ifdef CONFIG_HOTPLUG_CPU
 extern void cpu_exit_clear(void);
 extern void cpu_uninit(void);
_

Patches currently in -mm which might be from kmannth@xxxxxxxxxx are

origin.patch
hot-add-mem-x86_64-fixup-externs.patch
hot-add-mem-x86_64-kconfig-changes.patch
hot-add-mem-x86_64-enable-sparsemem-in-sratc.patch
hot-add-mem-x86_64-memory_add_physaddr_to_nid-enable.patch
hot-add-mem-x86_64-memory_add_physaddr_to_nid-node-fixup.patch
hot-add-mem-x86_64-use-config_memory_hotplug_sparse.patch
hot-add-mem-x86_64-use-config_memory_hotplug_reserve.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux