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 /arch/x86/kernel/smpboot.c | |
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>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 16 |
1 files changed, 16 insertions, 0 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 | { |