x86, numa: Fix cpu to node mapping for sparse node ids
[deliverable/linux.git] / arch / x86 / mm / numa_64.c
index dd300c491f1f5e06d9d21d152cc9bffb313adebb..3d73201ba3475414bfbe402a6d0dfb70e89e5742 100644 (file)
@@ -266,25 +266,24 @@ static char *cmdline __initdata;
 static int __init setup_physnodes(unsigned long start, unsigned long end,
                                        int acpi, int amd)
 {
-       int nr_nodes = 0;
        int ret = 0;
        int i;
 
        memset(physnodes, 0, sizeof(physnodes));
 #ifdef CONFIG_ACPI_NUMA
        if (acpi)
-               nr_nodes = acpi_get_nodes(physnodes);
+               acpi_get_nodes(physnodes, start, end);
 #endif
 #ifdef CONFIG_AMD_NUMA
        if (amd)
-               nr_nodes = amd_get_nodes(physnodes);
+               amd_get_nodes(physnodes);
 #endif
        /*
         * Basic sanity checking on the physical node map: there may be errors
         * if the SRAT or AMD code incorrectly reported the topology or the mem=
         * kernel parameter is used.
         */
-       for (i = 0; i < nr_nodes; i++) {
+       for (i = 0; i < MAX_NUMNODES; i++) {
                if (physnodes[i].start == physnodes[i].end)
                        continue;
                if (physnodes[i].start > end) {
@@ -299,17 +298,6 @@ static int __init setup_physnodes(unsigned long start, unsigned long end,
                        physnodes[i].start = start;
                if (physnodes[i].end > end)
                        physnodes[i].end = end;
-       }
-
-       /*
-        * Remove all nodes that have no memory or were truncated because of the
-        * limited address range.
-        */
-       for (i = 0; i < nr_nodes; i++) {
-               if (physnodes[i].start == physnodes[i].end)
-                       continue;
-               physnodes[ret].start = physnodes[i].start;
-               physnodes[ret].end = physnodes[i].end;
                ret++;
        }
 
This page took 0.028347 seconds and 5 git commands to generate.