diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2012-01-26 06:44:34 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-01-27 07:28:48 -0500 |
commit | 39be350127ec60a078edffe5b4915dafba4ba514 (patch) | |
tree | 9b1ad6ee75c3b5842434b697b96ccdfbe1a40a2f /include/linux/sched.h | |
parent | cb297a3e433dbdcf7ad81e0564e7b804c941ff0d (diff) |
sched, block: Unify cache detection
The block layer has some code trying to determine if two CPUs share a
cache, the scheduler has a similar function. Expose the function used
by the scheduler and make the block layer use it, thereby removing the
block layers usage of CONFIG_SCHED* and topology bits.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Jens Axboe <axboe@kernel.dk>
Link: http://lkml.kernel.org/r/1327579450.2446.95.camel@twins
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 513f52459872..0e1959568836 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1052,6 +1052,8 @@ static inline int test_sd_parent(struct sched_domain *sd, int flag) | |||
1052 | unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu); | 1052 | unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu); |
1053 | unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); | 1053 | unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); |
1054 | 1054 | ||
1055 | bool cpus_share_cache(int this_cpu, int that_cpu); | ||
1056 | |||
1055 | #else /* CONFIG_SMP */ | 1057 | #else /* CONFIG_SMP */ |
1056 | 1058 | ||
1057 | struct sched_domain_attr; | 1059 | struct sched_domain_attr; |
@@ -1061,6 +1063,12 @@ partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], | |||
1061 | struct sched_domain_attr *dattr_new) | 1063 | struct sched_domain_attr *dattr_new) |
1062 | { | 1064 | { |
1063 | } | 1065 | } |
1066 | |||
1067 | static inline bool cpus_share_cache(int this_cpu, int that_cpu) | ||
1068 | { | ||
1069 | return true; | ||
1070 | } | ||
1071 | |||
1064 | #endif /* !CONFIG_SMP */ | 1072 | #endif /* !CONFIG_SMP */ |
1065 | 1073 | ||
1066 | 1074 | ||