diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-03-03 12:13:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:40:56 -0400 |
commit | 70708a18e834fd709a4f497bb419ec84d1eb3511 (patch) | |
tree | d93d39ca9829f762f51406f9759d2dd54a88e112 | |
parent | 768d95051bdaf60b4eb89b42c133b14627f478f2 (diff) |
x86: move cpu_coregroup_map to common file
it is equal between architectures
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/smpboot.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 14 |
3 files changed, 16 insertions, 28 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index d774520a6b48..644e60969f90 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/init.h> | 1 | #include <linux/init.h> |
2 | #include <linux/smp.h> | 2 | #include <linux/smp.h> |
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/sched.h> | ||
4 | 5 | ||
5 | /* Number of siblings per CPU package */ | 6 | /* Number of siblings per CPU package */ |
6 | int smp_num_siblings = 1; | 7 | int smp_num_siblings = 1; |
@@ -95,6 +96,21 @@ void __cpuinit set_cpu_sibling_map(int cpu) | |||
95 | } | 96 | } |
96 | } | 97 | } |
97 | 98 | ||
99 | /* maps the cpu to the sched domain representing multi-core */ | ||
100 | cpumask_t cpu_coregroup_map(int cpu) | ||
101 | { | ||
102 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
103 | /* | ||
104 | * For perf, we return last level cache shared map. | ||
105 | * And for power savings, we return cpu_core_map | ||
106 | */ | ||
107 | if (sched_mc_power_savings || sched_smt_power_savings) | ||
108 | return per_cpu(cpu_core_map, cpu); | ||
109 | else | ||
110 | return c->llc_shared_map; | ||
111 | } | ||
112 | |||
113 | |||
98 | #ifdef CONFIG_HOTPLUG_CPU | 114 | #ifdef CONFIG_HOTPLUG_CPU |
99 | void remove_siblinginfo(int cpu) | 115 | void remove_siblinginfo(int cpu) |
100 | { | 116 | { |
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index 322f46674d42..a58ca7f18013 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -260,20 +260,6 @@ static void __cpuinit smp_callin(void) | |||
260 | 260 | ||
261 | static int cpucount; | 261 | static int cpucount; |
262 | 262 | ||
263 | /* maps the cpu to the sched domain representing multi-core */ | ||
264 | cpumask_t cpu_coregroup_map(int cpu) | ||
265 | { | ||
266 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
267 | /* | ||
268 | * For perf, we return last level cache shared map. | ||
269 | * And for power savings, we return cpu_core_map | ||
270 | */ | ||
271 | if (sched_mc_power_savings || sched_smt_power_savings) | ||
272 | return per_cpu(cpu_core_map, cpu); | ||
273 | else | ||
274 | return c->llc_shared_map; | ||
275 | } | ||
276 | |||
277 | /* | 263 | /* |
278 | * Activate a secondary processor. | 264 | * Activate a secondary processor. |
279 | */ | 265 | */ |
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index 329f9c53a335..1a592400d94f 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -211,20 +211,6 @@ void __cpuinit smp_callin(void) | |||
211 | cpu_set(cpuid, cpu_callin_map); | 211 | cpu_set(cpuid, cpu_callin_map); |
212 | } | 212 | } |
213 | 213 | ||
214 | /* maps the cpu to the sched domain representing multi-core */ | ||
215 | cpumask_t cpu_coregroup_map(int cpu) | ||
216 | { | ||
217 | struct cpuinfo_x86 *c = &cpu_data(cpu); | ||
218 | /* | ||
219 | * For perf, we return last level cache shared map. | ||
220 | * And for power savings, we return cpu_core_map | ||
221 | */ | ||
222 | if (sched_mc_power_savings || sched_smt_power_savings) | ||
223 | return per_cpu(cpu_core_map, cpu); | ||
224 | else | ||
225 | return c->llc_shared_map; | ||
226 | } | ||
227 | |||
228 | /* | 214 | /* |
229 | * Setup code on secondary processor (after comming out of the trampoline) | 215 | * Setup code on secondary processor (after comming out of the trampoline) |
230 | */ | 216 | */ |