This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc64 / mm / numa.c
index 5d902b7..2f01f75 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/module.h>
-#include <linux/nodemask.h>
 #include <linux/cpu.h>
 #include <linux/notifier.h>
 #include <asm/lmb.h>
@@ -216,7 +215,7 @@ static int numa_setup_cpu(unsigned long lcpu)
 
        numa_domain = of_node_numa_domain(cpu);
 
-       if (numa_domain >= numnodes) {
+       if (numa_domain >= MAX_NUMNODES) {
                /*
                 * POWER4 LPAR uses 0xffff as invalid node,
                 * dont warn in this case.
@@ -265,7 +264,6 @@ static int cpu_numa_callback(struct notifier_block *nfb,
 
 static int __init parse_numa_properties(void)
 {
-       struct device_node *cpu = NULL;
        struct device_node *memory = NULL;
        int max_domain = 0;
        long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT;
@@ -291,28 +289,6 @@ static int __init parse_numa_properties(void)
 
        max_domain = numa_setup_cpu(boot_cpuid);
 
-       /*
-        * Even though we connect cpus to numa domains later in SMP init,
-        * we need to know the maximum node id now. This is because each
-        * node id must have NODE_DATA etc backing it.
-        * As a result of hotplug we could still have cpus appear later on
-        * with larger node ids. In that case we force the cpu into node 0.
-        */
-       for_each_cpu(i) {
-               int numa_domain;
-
-               cpu = find_cpu_node(i);
-
-               if (cpu) {
-                       numa_domain = of_node_numa_domain(cpu);
-                       of_node_put(cpu);
-
-                       if (numa_domain < MAX_NUMNODES &&
-                           max_domain < numa_domain)
-                               max_domain = numa_domain;
-               }
-       }
-
        memory = NULL;
        while ((memory = of_find_node_by_type(memory, "memory")) != NULL) {
                unsigned long start;
@@ -503,10 +479,6 @@ static unsigned long careful_allocation(int nid, unsigned long size,
 void __init do_init_bootmem(void)
 {
        int nid;
-       static struct notifier_block ppc64_numa_nb = {
-               .notifier_call = cpu_numa_callback,
-               .priority = 1 /* Must run before sched domains notifier. */
-       };
 
        min_low_pfn = 0;
        max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
@@ -516,8 +488,10 @@ void __init do_init_bootmem(void)
                setup_nonnuma();
        else
                dump_numa_topology();
-
-       register_cpu_notifier(&ppc64_numa_nb);
+       /*
+        * This must run before the sched domains notifier.
+        */
+       hotcpu_notifier(cpu_numa_callback, 1);
 
        for (nid = 0; nid < numnodes; nid++) {
                unsigned long start_paddr, end_paddr;