diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-23 08:37:40 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-28 08:54:09 -0500 |
commit | 645a79195f66eb68ef3ab2b21d9829ac3aa085a9 (patch) | |
tree | 5808c94ad0371f70a391e1e77baf12465969e19c /arch/x86/kernel/smpboot.c | |
parent | bbc9e2f452d9c4b166d1f9a78d941d80173312fe (diff) |
x86: Unify CPU -> NUMA node mapping between 32 and 64bit
Unlike 64bit, 32bit has been using its own cpu_to_node_map[] for
CPU -> NUMA node mapping. Replace it with early_percpu variable
x86_cpu_to_node_map and share the mapping code with 64bit.
* USE_PERCPU_NUMA_NODE_ID is now enabled for 32bit too.
* x86_cpu_to_node_map and numa_set/clear_node() are moved from
numa_64 to numa. For now, on 32bit, x86_cpu_to_node_map is initialized
with 0 instead of NUMA_NO_NODE. This is to avoid introducing unexpected
behavior change and will be updated once init path is unified.
* srat_detect_node() is now enabled for x86_32 too. It calls
numa_set_node() and initializes the mapping making explicit
cpu_to_node_map[] updates from map/unmap_cpu_to_node() unnecessary.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: eric.dumazet@gmail.com
Cc: yinghai@kernel.org
Cc: brgerst@gmail.com
Cc: gorcunov@gmail.com
Cc: penberg@kernel.org
Cc: shaohui.zheng@intel.com
Cc: rientjes@google.com
LKML-Reference: <1295789862-25482-15-git-send-email-tj@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: David Rientjes <rientjes@google.com>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index b7cfce535cb0..2c203822424f 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -133,16 +133,11 @@ EXPORT_PER_CPU_SYMBOL(cpu_info); | |||
133 | atomic_t init_deasserted; | 133 | atomic_t init_deasserted; |
134 | 134 | ||
135 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) | 135 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) |
136 | /* which node each logical CPU is on */ | ||
137 | int cpu_to_node_map[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = 0 }; | ||
138 | EXPORT_SYMBOL(cpu_to_node_map); | ||
139 | |||
140 | /* set up a mapping between cpu and node. */ | 136 | /* set up a mapping between cpu and node. */ |
141 | static void map_cpu_to_node(int cpu, int node) | 137 | static void map_cpu_to_node(int cpu, int node) |
142 | { | 138 | { |
143 | printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node); | 139 | printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node); |
144 | cpumask_set_cpu(cpu, node_to_cpumask_map[node]); | 140 | cpumask_set_cpu(cpu, node_to_cpumask_map[node]); |
145 | cpu_to_node_map[cpu] = node; | ||
146 | } | 141 | } |
147 | 142 | ||
148 | /* undo a mapping between cpu and node. */ | 143 | /* undo a mapping between cpu and node. */ |
@@ -153,7 +148,6 @@ static void unmap_cpu_to_node(int cpu) | |||
153 | printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu); | 148 | printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu); |
154 | for (node = 0; node < MAX_NUMNODES; node++) | 149 | for (node = 0; node < MAX_NUMNODES; node++) |
155 | cpumask_clear_cpu(cpu, node_to_cpumask_map[node]); | 150 | cpumask_clear_cpu(cpu, node_to_cpumask_map[node]); |
156 | cpu_to_node_map[cpu] = 0; | ||
157 | } | 151 | } |
158 | #else /* !(CONFIG_NUMA && CONFIG_X86_32) */ | 152 | #else /* !(CONFIG_NUMA && CONFIG_X86_32) */ |
159 | #define map_cpu_to_node(cpu, node) ({}) | 153 | #define map_cpu_to_node(cpu, node) ({}) |