]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/srat_64.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / srat_64.c
index bccbdc7be434c328677873b96e260d9c4c982cdd..845001c617cc7130697b5e659f3e5ce0e71eb936 100644 (file)
@@ -166,7 +166,8 @@ static inline int save_add_info(void) {return 0;}
  * Both SPARSE and RESERVE need nodes_add information.
  * This code supports one contiguous hot add area per node.
  */
-static int reserve_hotadd(int node, unsigned long start, unsigned long end)
+static int __init
+reserve_hotadd(int node, unsigned long start, unsigned long end)
 {
        unsigned long s_pfn = start >> PAGE_SHIFT;
        unsigned long e_pfn = end >> PAGE_SHIFT;
@@ -323,7 +324,7 @@ static int __init nodes_cover_memory(const struct bootnode *nodes)
        return 1;
 }
 
-static void unparse_node(int node)
+static void __init unparse_node(int node)
 {
        int i;
        node_clear(node, nodes_parsed);
@@ -346,8 +347,12 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
        /* First clean up the node list */
        for (i = 0; i < MAX_NUMNODES; i++) {
                cutoff_node(i, start, end);
-               /* ZZZ why was this needed. At least add a comment */
-               if (nodes[i].end && (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
+               /*
+                * don't confuse VM with a node that doesn't have the
+                * minimum memory.
+                */
+               if (nodes[i].end &&
+                       (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
                        unparse_node(i);
                        node_set_offline(i);
                }
@@ -378,9 +383,11 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
                        setup_node_bootmem(i, nodes[i].start, nodes[i].end);
 
        for (i = 0; i < NR_CPUS; i++) {
-               if (cpu_to_node(i) == NUMA_NO_NODE)
+               int node = early_cpu_to_node(i);
+
+               if (node == NUMA_NO_NODE)
                        continue;
-               if (!node_isset(cpu_to_node(i), node_possible_map))
+               if (!node_isset(node, node_possible_map))
                        numa_set_node(i, NUMA_NO_NODE);
        }
        numa_init_array();
@@ -391,7 +398,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
 static int fake_node_to_pxm_map[MAX_NUMNODES] __initdata = {
        [0 ... MAX_NUMNODES-1] = PXM_INVAL
 };
-static u16 fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = {
+static s16 fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = {
        [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
 };
 static int __init find_node_by_addr(unsigned long addr)
@@ -410,7 +417,7 @@ static int __init find_node_by_addr(unsigned long addr)
                        break;
                }
        }
-       return i;
+       return ret;
 }
 
 /*
@@ -482,7 +489,8 @@ void __init srat_reserve_add_area(int nodeid)
                printk(KERN_INFO "SRAT: This will cost you %Lu MB of "
                                "pre-allocated memory.\n", (unsigned long long)total_mb);
                reserve_bootmem_node(NODE_DATA(nodeid), nodes_add[nodeid].start,
-                              nodes_add[nodeid].end - nodes_add[nodeid].start);
+                              nodes_add[nodeid].end - nodes_add[nodeid].start,
+                              BOOTMEM_DEFAULT);
        }
 }