diff options
author | Mike Travis <travis@sgi.com> | 2009-01-04 08:18:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-04 09:39:26 -0500 |
commit | c2d1cec1c77f7714672c1efeae075424c929e0d5 (patch) | |
tree | 94afecf37405b93b6807377e4e99cc2ac9323034 /arch/x86/kernel/cpu/common.c | |
parent | 588235bb53f2c215f0d4b08fd30b461fedc3338e (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/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 3f95a40f718a..83492b1f93b1 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -40,6 +40,26 @@ | |||
40 | 40 | ||
41 | #include "cpu.h" | 41 | #include "cpu.h" |
42 | 42 | ||
43 | #ifdef CONFIG_X86_64 | ||
44 | |||
45 | /* all of these masks are initialized in setup_cpu_local_masks() */ | ||
46 | cpumask_var_t cpu_callin_mask; | ||
47 | cpumask_var_t cpu_callout_mask; | ||
48 | cpumask_var_t cpu_initialized_mask; | ||
49 | |||
50 | /* representing cpus for which sibling maps can be computed */ | ||
51 | cpumask_var_t cpu_sibling_setup_mask; | ||
52 | |||
53 | #else /* CONFIG_X86_32 */ | ||
54 | |||
55 | cpumask_t cpu_callin_map; | ||
56 | cpumask_t cpu_callout_map; | ||
57 | cpumask_t cpu_initialized; | ||
58 | cpumask_t cpu_sibling_setup_map; | ||
59 | |||
60 | #endif /* CONFIG_X86_32 */ | ||
61 | |||
62 | |||
43 | static struct cpu_dev *this_cpu __cpuinitdata; | 63 | static struct cpu_dev *this_cpu __cpuinitdata; |
44 | 64 | ||
45 | #ifdef CONFIG_X86_64 | 65 | #ifdef CONFIG_X86_64 |
@@ -856,8 +876,6 @@ static __init int setup_disablecpuid(char *arg) | |||
856 | } | 876 | } |
857 | __setup("clearcpuid=", setup_disablecpuid); | 877 | __setup("clearcpuid=", setup_disablecpuid); |
858 | 878 | ||
859 | cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; | ||
860 | |||
861 | #ifdef CONFIG_X86_64 | 879 | #ifdef CONFIG_X86_64 |
862 | struct x8664_pda **_cpu_pda __read_mostly; | 880 | struct x8664_pda **_cpu_pda __read_mostly; |
863 | EXPORT_SYMBOL(_cpu_pda); | 881 | EXPORT_SYMBOL(_cpu_pda); |
@@ -976,7 +994,7 @@ void __cpuinit cpu_init(void) | |||
976 | 994 | ||
977 | me = current; | 995 | me = current; |
978 | 996 | ||
979 | if (cpu_test_and_set(cpu, cpu_initialized)) | 997 | if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) |
980 | panic("CPU#%d already initialized!\n", cpu); | 998 | panic("CPU#%d already initialized!\n", cpu); |
981 | 999 | ||
982 | printk(KERN_INFO "Initializing CPU#%d\n", cpu); | 1000 | printk(KERN_INFO "Initializing CPU#%d\n", cpu); |
@@ -1085,7 +1103,7 @@ void __cpuinit cpu_init(void) | |||
1085 | struct tss_struct *t = &per_cpu(init_tss, cpu); | 1103 | struct tss_struct *t = &per_cpu(init_tss, cpu); |
1086 | struct thread_struct *thread = &curr->thread; | 1104 | struct thread_struct *thread = &curr->thread; |
1087 | 1105 | ||
1088 | if (cpu_test_and_set(cpu, cpu_initialized)) { | 1106 | if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) { |
1089 | printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); | 1107 | printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); |
1090 | for (;;) local_irq_enable(); | 1108 | for (;;) local_irq_enable(); |
1091 | } | 1109 | } |