Skip to content

Commit

Permalink
blk-mq: Include all present CPUs in the default queue mapping
Browse files Browse the repository at this point in the history
This way we get a nice distribution independent of the current cpu
online / offline state.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Jens Axboe <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
Christoph Hellwig authored and KAGA-KOKO committed Jun 28, 2017
1 parent bf22ff4 commit 5f042e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/blk-mq-cpumap.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ int blk_mq_map_queues(struct blk_mq_tag_set *set)
{
unsigned int *map = set->mq_map;
unsigned int nr_queues = set->nr_hw_queues;
const struct cpumask *online_mask = cpu_online_mask;
unsigned int i, nr_cpus, nr_uniq_cpus, queue, first_sibling;
cpumask_var_t cpus;

Expand All @@ -44,7 +43,7 @@ int blk_mq_map_queues(struct blk_mq_tag_set *set)

cpumask_clear(cpus);
nr_cpus = nr_uniq_cpus = 0;
for_each_cpu(i, online_mask) {
for_each_present_cpu(i) {
nr_cpus++;
first_sibling = get_first_sibling(i);
if (!cpumask_test_cpu(first_sibling, cpus))
Expand All @@ -54,7 +53,7 @@ int blk_mq_map_queues(struct blk_mq_tag_set *set)

queue = 0;
for_each_possible_cpu(i) {
if (!cpumask_test_cpu(i, online_mask)) {
if (!cpumask_test_cpu(i, cpu_present_mask)) {
map[i] = 0;
continue;
}
Expand Down

0 comments on commit 5f042e7

Please sign in to comment.