diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-13 23:30:50 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-13 23:30:50 -0400 |
commit | 3a20b086526106a315b52a44339d8d2900eef6c6 (patch) | |
tree | 6f75327b466c895da777ce62ccdac3d40b6031c2 /arch | |
parent | 32b0d2e92d12a13051fc985bcc7f5ae7ee98a339 (diff) |
Add /proc/litmus/cluster_cache
- read L2, L3 clustering from proc file (default L2)
- check for "feasible cluster size"
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 4e60b624d121..e75daac64962 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -172,7 +172,7 @@ extern void print_cpu_info(struct cpuinfo_x86 *); | |||
172 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | 172 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
173 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 173 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
174 | extern unsigned short num_cache_leaves; | 174 | extern unsigned short num_cache_leaves; |
175 | extern void get_shared_cpu_map(cpumask_var_t mask, | 175 | extern int get_shared_cpu_map(cpumask_var_t mask, |
176 | unsigned int cpu, int index); | 176 | unsigned int cpu, int index); |
177 | 177 | ||
178 | extern void detect_extended_topology(struct cpuinfo_x86 *c); | 178 | extern void detect_extended_topology(struct cpuinfo_x86 *c); |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index ffdc69c05e4c..ea348f24c23b 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -516,13 +516,21 @@ static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); | |||
516 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) | 516 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) |
517 | 517 | ||
518 | /* returns CPUs that share the index cache with cpu */ | 518 | /* returns CPUs that share the index cache with cpu */ |
519 | void get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) | 519 | int get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) |
520 | { | 520 | { |
521 | int ret = 0; | ||
521 | struct _cpuid4_info *this_leaf; | 522 | struct _cpuid4_info *this_leaf; |
522 | 523 | ||
524 | printk(KERN_INFO "idx = %d, max = %d\n", index, num_cache_leaves); | ||
525 | if (index >= num_cache_leaves) { | ||
526 | index = num_cache_leaves - 1; | ||
527 | ret = index; | ||
528 | } | ||
529 | |||
523 | this_leaf = CPUID4_INFO_IDX(cpu,index); | 530 | this_leaf = CPUID4_INFO_IDX(cpu,index); |
524 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); | 531 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); |
525 | return; | 532 | |
533 | return ret; | ||
526 | } | 534 | } |
527 | 535 | ||
528 | #ifdef CONFIG_SMP | 536 | #ifdef CONFIG_SMP |