aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-01-23 08:37:30 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-28 08:54:05 -0500
commit4c321ff8a01a95badf5d5403d80ca4e0ab07fce7 (patch)
tree6fb9715b01c94988e20fa3ac2324c364854e6a79 /arch/x86/kernel/smpboot.c
parent1245e1668c6e52bee76a423f8fab3bfcdd6226ae (diff)
x86: Replace cpu_2_logical_apicid[] with early percpu variable
Unlike x86_64, on x86_32, the mapping from cpu to logical apicid may vary depending on apic in use. cpu_2_logical_apicid[] array is used for this mapping. Replace it with early percpu variable x86_cpu_to_logical_apicid to make it better aligned with other mappings. 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-5-git-send-email-tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 53a85baaecca..df934e46bf53 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -165,9 +165,6 @@ static void unmap_cpu_to_node(int cpu)
165#endif 165#endif
166 166
167#ifdef CONFIG_X86_32 167#ifdef CONFIG_X86_32
168u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly =
169 { [0 ... NR_CPUS-1] = BAD_APICID };
170
171static void map_cpu_to_logical_apicid(void) 168static void map_cpu_to_logical_apicid(void)
172{ 169{
173 int cpu = smp_processor_id(); 170 int cpu = smp_processor_id();
@@ -177,13 +174,13 @@ static void map_cpu_to_logical_apicid(void)
177 if (!node_online(node)) 174 if (!node_online(node))
178 node = first_online_node; 175 node = first_online_node;
179 176
180 cpu_2_logical_apicid[cpu] = apicid; 177 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = apicid;
181 map_cpu_to_node(cpu, node); 178 map_cpu_to_node(cpu, node);
182} 179}
183 180
184void numa_remove_cpu(int cpu) 181void numa_remove_cpu(int cpu)
185{ 182{
186 cpu_2_logical_apicid[cpu] = BAD_APICID; 183 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = BAD_APICID;
187 unmap_cpu_to_node(cpu); 184 unmap_cpu_to_node(cpu);
188} 185}
189#else 186#else