diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-13 00:19:50 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-13 00:19:50 -0400 |
commit | 7ad728f98162cb1af06a85b2a5fc422dddd4fb78 (patch) | |
tree | 85a326e35ff5d37d89aa7a687a623cded6fcb190 /arch/x86/include | |
parent | fcef8576d8a64fc603e719c97d423f9f6d4e0e8b (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/include')
-rw-r--r-- | arch/x86/include/asm/smp.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/topology.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 47d0e21f2b9e..cfb10f1667fe 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -21,19 +21,19 @@ | |||
21 | extern int smp_num_siblings; | 21 | extern int smp_num_siblings; |
22 | extern unsigned int num_processors; | 22 | extern unsigned int num_processors; |
23 | 23 | ||
24 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 24 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
25 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | 25 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); |
26 | DECLARE_PER_CPU(u16, cpu_llc_id); | 26 | DECLARE_PER_CPU(u16, cpu_llc_id); |
27 | DECLARE_PER_CPU(int, cpu_number); | 27 | DECLARE_PER_CPU(int, cpu_number); |
28 | 28 | ||
29 | static inline struct cpumask *cpu_sibling_mask(int cpu) | 29 | static inline struct cpumask *cpu_sibling_mask(int cpu) |
30 | { | 30 | { |
31 | return &per_cpu(cpu_sibling_map, cpu); | 31 | return per_cpu(cpu_sibling_map, cpu); |
32 | } | 32 | } |
33 | 33 | ||
34 | static inline struct cpumask *cpu_core_mask(int cpu) | 34 | static inline struct cpumask *cpu_core_mask(int cpu) |
35 | { | 35 | { |
36 | return &per_cpu(cpu_core_map, cpu); | 36 | return per_cpu(cpu_core_map, cpu); |
37 | } | 37 | } |
38 | 38 | ||
39 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); | 39 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index f7c20d031422..fa4aa42e976d 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -249,8 +249,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu); | |||
249 | #ifdef ENABLE_TOPO_DEFINES | 249 | #ifdef ENABLE_TOPO_DEFINES |
250 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) | 250 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) |
251 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) | 251 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) |
252 | #define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu)) | 252 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
253 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | 253 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
254 | 254 | ||
255 | /* indicates that pointers to the topology cpumask_t maps are valid */ | 255 | /* indicates that pointers to the topology cpumask_t maps are valid */ |
256 | #define arch_provides_topology_pointers yes | 256 | #define arch_provides_topology_pointers yes |
@@ -264,7 +264,7 @@ struct pci_bus; | |||
264 | void set_pci_bus_resources_arch_default(struct pci_bus *b); | 264 | void set_pci_bus_resources_arch_default(struct pci_bus *b); |
265 | 265 | ||
266 | #ifdef CONFIG_SMP | 266 | #ifdef CONFIG_SMP |
267 | #define mc_capable() (cpus_weight(per_cpu(cpu_core_map, 0)) != nr_cpu_ids) | 267 | #define mc_capable() (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids) |
268 | #define smt_capable() (smp_num_siblings > 1) | 268 | #define smt_capable() (smp_num_siblings > 1) |
269 | #endif | 269 | #endif |
270 | 270 | ||