aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:50 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:50 -0400
commit7ad728f98162cb1af06a85b2a5fc422dddd4fb78 (patch)
tree85a326e35ff5d37d89aa7a687a623cded6fcb190 /arch/x86/kernel/smpboot.c
parentfcef8576d8a64fc603e719c97d423f9f6d4e0e8b (diff)
cpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t
Impact: reduce per-cpu size for CONFIG_CPUMASK_OFFSTACK=y In most places it's cleaner to use the accessors cpu_sibling_mask() and cpu_core_mask() wrappers which already exist. I couldn't avoid cleaning up the access in oprofile, either. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f534257d4b46..7f051c170add 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -101,11 +101,11 @@ EXPORT_SYMBOL(smp_num_siblings);
101DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; 101DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID;
102 102
103/* representing HT siblings of each logical CPU */ 103/* representing HT siblings of each logical CPU */
104DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); 104DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);
105EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); 105EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
106 106
107/* representing HT and core siblings of each logical CPU */ 107/* representing HT and core siblings of each logical CPU */
108DEFINE_PER_CPU(cpumask_t, cpu_core_map); 108DEFINE_PER_CPU(cpumask_var_t, cpu_core_map);
109EXPORT_PER_CPU_SYMBOL(cpu_core_map); 109EXPORT_PER_CPU_SYMBOL(cpu_core_map);
110 110
111/* Per CPU bogomips and other parameters */ 111/* Per CPU bogomips and other parameters */
@@ -1026,6 +1026,8 @@ static void __init smp_cpu_index_default(void)
1026 */ 1026 */
1027void __init native_smp_prepare_cpus(unsigned int max_cpus) 1027void __init native_smp_prepare_cpus(unsigned int max_cpus)
1028{ 1028{
1029 unsigned int i;
1030
1029 preempt_disable(); 1031 preempt_disable();
1030 smp_cpu_index_default(); 1032 smp_cpu_index_default();
1031 current_cpu_data = boot_cpu_data; 1033 current_cpu_data = boot_cpu_data;
@@ -1039,6 +1041,12 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1039 boot_cpu_logical_apicid = logical_smp_processor_id(); 1041 boot_cpu_logical_apicid = logical_smp_processor_id();
1040#endif 1042#endif
1041 current_thread_info()->cpu = 0; /* needed? */ 1043 current_thread_info()->cpu = 0; /* needed? */
1044 for_each_possible_cpu(i) {
1045 alloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
1046 alloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
1047 cpumask_clear(per_cpu(cpu_core_map, i));
1048 cpumask_clear(per_cpu(cpu_sibling_map, i));
1049 }
1042 set_cpu_sibling_map(0); 1050 set_cpu_sibling_map(0);
1043 1051
1044 enable_IR_x2apic(); 1052 enable_IR_x2apic();