aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 669a15e7fa76..6dc07ddbfd04 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -581,30 +581,22 @@ static void verify_cpu_node_mapping(int cpu, int node)
581 } 581 }
582} 582}
583 583
584static int cpu_numa_callback(struct notifier_block *nfb, unsigned long action, 584/* Must run before sched domains notifier. */
585 void *hcpu) 585static int ppc_numa_cpu_prepare(unsigned int cpu)
586{ 586{
587 unsigned long lcpu = (unsigned long)hcpu; 587 int nid;
588 int ret = NOTIFY_DONE, nid;
589 588
590 switch (action) { 589 nid = numa_setup_cpu(cpu);
591 case CPU_UP_PREPARE: 590 verify_cpu_node_mapping(cpu, nid);
592 case CPU_UP_PREPARE_FROZEN: 591 return 0;
593 nid = numa_setup_cpu(lcpu); 592}
594 verify_cpu_node_mapping((int)lcpu, nid); 593
595 ret = NOTIFY_OK; 594static int ppc_numa_cpu_dead(unsigned int cpu)
596 break; 595{
597#ifdef CONFIG_HOTPLUG_CPU 596#ifdef CONFIG_HOTPLUG_CPU
598 case CPU_DEAD: 597 unmap_cpu_from_node(cpu);
599 case CPU_DEAD_FROZEN:
600 case CPU_UP_CANCELED:
601 case CPU_UP_CANCELED_FROZEN:
602 unmap_cpu_from_node(lcpu);
603 ret = NOTIFY_OK;
604 break;
605#endif 598#endif
606 } 599 return 0;
607 return ret;
608} 600}
609 601
610/* 602/*
@@ -913,11 +905,6 @@ static void __init dump_numa_memory_topology(void)
913 } 905 }
914} 906}
915 907
916static struct notifier_block ppc64_numa_nb = {
917 .notifier_call = cpu_numa_callback,
918 .priority = 1 /* Must run before sched domains notifier. */
919};
920
921/* Initialize NODE_DATA for a node on the local memory */ 908/* Initialize NODE_DATA for a node on the local memory */
922static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) 909static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
923{ 910{
@@ -985,15 +972,18 @@ void __init initmem_init(void)
985 setup_node_to_cpumask_map(); 972 setup_node_to_cpumask_map();
986 973
987 reset_numa_cpu_lookup_table(); 974 reset_numa_cpu_lookup_table();
988 register_cpu_notifier(&ppc64_numa_nb); 975
989 /* 976 /*
990 * We need the numa_cpu_lookup_table to be accurate for all CPUs, 977 * We need the numa_cpu_lookup_table to be accurate for all CPUs,
991 * even before we online them, so that we can use cpu_to_{node,mem} 978 * even before we online them, so that we can use cpu_to_{node,mem}
992 * early in boot, cf. smp_prepare_cpus(). 979 * early in boot, cf. smp_prepare_cpus().
980 * _nocalls() + manual invocation is used because cpuhp is not yet
981 * initialized for the boot CPU.
993 */ 982 */
994 for_each_present_cpu(cpu) { 983 cpuhp_setup_state_nocalls(CPUHP_POWER_NUMA_PREPARE, "POWER_NUMA_PREPARE",
995 numa_setup_cpu((unsigned long)cpu); 984 ppc_numa_cpu_prepare, ppc_numa_cpu_dead);
996 } 985 for_each_present_cpu(cpu)
986 numa_setup_cpu(cpu);
997} 987}
998 988
999static int __init early_numa(char *p) 989static int __init early_numa(char *p)