]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ia64: deal with lack of SRAT in GENERIC kernels
authorJesse Barnes <jbarnes@sgi.com>
Thu, 9 Oct 2003 06:59:30 +0000 (23:59 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 9 Oct 2003 06:59:30 +0000 (23:59 -0700)
n 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.

arch/ia64/kernel/acpi.c

index d446f47a0ec4995e452b705d50aeeb9417464675..a81b9200cb3c1525acc1a36cd0ac68acf6c50cc7 100644 (file)
@@ -453,6 +453,12 @@ acpi_numa_arch_fixup (void)
 {
        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 @@ acpi_boot_init (void)
 
        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