Skip to contentSkip to conversation

deal with lack of SRAT in generic kernels

PATCH New Jesse Barnes 1 participant 1 message Oct 6, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 deal with lack of SRAT in generic kernels

On platforms without an SRAT (e.g. zx1), the cpu_to_node_map will get built incorrectly without this fix, making generic kernels fail when they try to alloc_pages_node() from a nodeid of -1. This is a simple port forward of the 2.4 code, please let me know if you'd like this stuff cleaned up before it goes in or if it's ok the way it is.

 acpi.c |   12 ++++++++++++

Thanks,
Jesse

arch/ia64/kernel/acpi.c +12 -0
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
@@ -453,6 +453,12 @@
 {
 	int i, j, node_from, node_to;
 
+	/* If there's no SRAT, fix the phys_id */
+	if (srat_num_cpus = 0) {
+		node_cpuid[0].phys_id = hard_smp_processor_id();
+		return;
+	}
+
 	/* calculate total number of nodes in system from PXM bitmap */
 	numnodes = 0;		/* init total nodes in system */
 
@@ -613,6 +619,12 @@
 
 	smp_build_cpu_map();
 # ifdef CONFIG_NUMA
+	if (srat_num_cpus = 0) {
+		int cpu, i = 1;
+		for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
+			if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
+				node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
+	}
 	build_cpu_to_node_map();
 # endif
 #endif