#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>
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.
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;
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;
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;
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;