X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc64%2Fmm%2Fnuma.c;h=2f01f75cb94e8343064648e53398daa29a5e6488;hb=9e1bf581d67d87a1d7fc0ea500729e3a03643a26;hp=5d902b744741ceeae0c3fbe41a8e1ea949503971;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c index 5d902b744..2f01f75cb 100644 --- a/arch/ppc64/mm/numa.c +++ b/arch/ppc64/mm/numa.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -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;