aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@linux.vnet.ibm.com>2014-05-19 14:14:23 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-05-27 23:35:33 -0400
commit8c272261194dfda11cc046fbe808e052f6f284eb (patch)
tree468cda65465b0f02bb1b0bf332a5bc3e8cb16538 /arch
parent86969cf7330a53c93edfd1bf2c28ad053e289162 (diff)
powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID
Based off 3bccd996 for ia64, convert powerpc to use the generic per-CPU topology tracking, specifically: initialize per cpu numa_node entry in start_secondary remove the powerpc cpu_to_node() define CONFIG_USE_PERCPU_NUMA_NODE_ID if NUMA Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/include/asm/topology.h13
-rw-r--r--arch/powerpc/kernel/smp.c6
3 files changed, 10 insertions, 13 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e0998997943b..9125964af409 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -453,6 +453,10 @@ config NODES_SHIFT
453 default "4" 453 default "4"
454 depends on NEED_MULTIPLE_NODES 454 depends on NEED_MULTIPLE_NODES
455 455
456config USE_PERCPU_NUMA_NODE_ID
457 def_bool y
458 depends on NUMA
459
456config ARCH_SELECT_MEMORY_MODEL 460config ARCH_SELECT_MEMORY_MODEL
457 def_bool y 461 def_bool y
458 depends on PPC64 462 depends on PPC64
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index c9202151079f..5ecf7ea52ad8 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -20,19 +20,6 @@ struct device_node;
20 20
21#include <asm/mmzone.h> 21#include <asm/mmzone.h>
22 22
23static inline int cpu_to_node(int cpu)
24{
25 int nid;
26
27 nid = numa_cpu_lookup_table[cpu];
28
29 /*
30 * During early boot, the numa-cpu lookup table might not have been
31 * setup for all CPUs yet. In such cases, default to node 0.
32 */
33 return (nid < 0) ? 0 : nid;
34}
35
36#define parent_node(node) (node) 23#define parent_node(node) (node)
37 24
38#define cpumask_of_node(node) ((node) == -1 ? \ 25#define cpumask_of_node(node) ((node) == -1 ? \
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index e2a4232c5871..d7252adea759 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -390,6 +390,7 @@ void smp_prepare_boot_cpu(void)
390#ifdef CONFIG_PPC64 390#ifdef CONFIG_PPC64
391 paca[boot_cpuid].__current = current; 391 paca[boot_cpuid].__current = current;
392#endif 392#endif
393 set_numa_node(numa_cpu_lookup_table[boot_cpuid]);
393 current_set[boot_cpuid] = task_thread_info(current); 394 current_set[boot_cpuid] = task_thread_info(current);
394} 395}
395 396
@@ -750,6 +751,11 @@ void start_secondary(void *unused)
750 } 751 }
751 traverse_core_siblings(cpu, true); 752 traverse_core_siblings(cpu, true);
752 753
754 /*
755 * numa_node_id() works after this.
756 */
757 set_numa_node(numa_cpu_lookup_table[cpu]);
758
753 smp_wmb(); 759 smp_wmb();
754 notify_cpu_starting(cpu); 760 notify_cpu_starting(cpu);
755 set_cpu_online(cpu, true); 761 set_cpu_online(cpu, true);