diff options
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/block/blk.h b/block/blk.h index a09c18b19116..faf94f2acb12 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -148,14 +148,18 @@ static inline int queue_congestion_off_threshold(struct request_queue *q) | |||
148 | 148 | ||
149 | static inline int blk_cpu_to_group(int cpu) | 149 | static inline int blk_cpu_to_group(int cpu) |
150 | { | 150 | { |
151 | int group = NR_CPUS; | ||
151 | #ifdef CONFIG_SCHED_MC | 152 | #ifdef CONFIG_SCHED_MC |
152 | const struct cpumask *mask = cpu_coregroup_mask(cpu); | 153 | const struct cpumask *mask = cpu_coregroup_mask(cpu); |
153 | return cpumask_first(mask); | 154 | group = cpumask_first(mask); |
154 | #elif defined(CONFIG_SCHED_SMT) | 155 | #elif defined(CONFIG_SCHED_SMT) |
155 | return cpumask_first(topology_thread_cpumask(cpu)); | 156 | group = cpumask_first(topology_thread_cpumask(cpu)); |
156 | #else | 157 | #else |
157 | return cpu; | 158 | return cpu; |
158 | #endif | 159 | #endif |
160 | if (likely(group < NR_CPUS)) | ||
161 | return group; | ||
162 | return cpu; | ||
159 | } | 163 | } |
160 | 164 | ||
161 | /* | 165 | /* |