aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_percpu.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2009-01-04 08:18:03 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-04 09:39:26 -0500
commitc2d1cec1c77f7714672c1efeae075424c929e0d5 (patch)
tree94afecf37405b93b6807377e4e99cc2ac9323034 /arch/x86/kernel/setup_percpu.c
parent588235bb53f2c215f0d4b08fd30b461fedc3338e (diff)
x86: cleanup remaining cpumask_t ops in smpboot code
Impact: use new cpumask API to reduce memory and stack usage Allocate the following local cpumasks based on the number of cpus that are present. References will use new cpumask API. (Currently only modified for x86_64, x86_32 continues to use the *_map variants.) cpu_callin_mask cpu_callout_mask cpu_initialized_mask cpu_sibling_setup_mask Provide the following accessor functions: struct cpumask *cpu_sibling_mask(int cpu) struct cpumask *cpu_core_mask(int cpu) Other changes are when setting or clearing the cpu online, possible or present maps, use the accessor functions. Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup_percpu.c')
-rw-r--r--arch/x86/kernel/setup_percpu.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index a4b619c33106..aa55764602b1 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -131,7 +131,27 @@ static void __init setup_cpu_pda_map(void)
131 /* point to new pointer table */ 131 /* point to new pointer table */
132 _cpu_pda = new_cpu_pda; 132 _cpu_pda = new_cpu_pda;
133} 133}
134#endif 134
135#endif /* CONFIG_SMP && CONFIG_X86_64 */
136
137#ifdef CONFIG_X86_64
138
139/* correctly size the local cpu masks */
140static void setup_cpu_local_masks(void)
141{
142 alloc_bootmem_cpumask_var(&cpu_initialized_mask);
143 alloc_bootmem_cpumask_var(&cpu_callin_mask);
144 alloc_bootmem_cpumask_var(&cpu_callout_mask);
145 alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask);
146}
147
148#else /* CONFIG_X86_32 */
149
150static inline void setup_cpu_local_masks(void)
151{
152}
153
154#endif /* CONFIG_X86_32 */
135 155
136/* 156/*
137 * Great future plan: 157 * Great future plan:
@@ -187,6 +207,9 @@ void __init setup_per_cpu_areas(void)
187 207
188 /* Setup node to cpumask map */ 208 /* Setup node to cpumask map */
189 setup_node_to_cpumask_map(); 209 setup_node_to_cpumask_map();
210
211 /* Setup cpu initialized, callin, callout masks */
212 setup_cpu_local_masks();
190} 213}
191 214
192#endif 215#endif