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 /block/blk.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 'block/blk.h')
-rw-r--r-- | block/blk.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/block/blk.h b/block/blk.h index 7efd772336de..df5b59acbdff 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -164,22 +164,6 @@ static inline int queue_congestion_off_threshold(struct request_queue *q) | |||
164 | return q->nr_congestion_off; | 164 | return q->nr_congestion_off; |
165 | } | 165 | } |
166 | 166 | ||
167 | static inline int blk_cpu_to_group(int cpu) | ||
168 | { | ||
169 | int group = NR_CPUS; | ||
170 | #ifdef CONFIG_SCHED_MC | ||
171 | const struct cpumask *mask = cpu_coregroup_mask(cpu); | ||
172 | group = cpumask_first(mask); | ||
173 | #elif defined(CONFIG_SCHED_SMT) | ||
174 | group = cpumask_first(topology_thread_cpumask(cpu)); | ||
175 | #else | ||
176 | return cpu; | ||
177 | #endif | ||
178 | if (likely(group < NR_CPUS)) | ||
179 | return group; | ||
180 | return cpu; | ||
181 | } | ||
182 | |||
183 | /* | 167 | /* |
184 | * Contribute to IO statistics IFF: | 168 | * Contribute to IO statistics IFF: |
185 | * | 169 | * |