Skip to content

Commit 5f042e7

Browse files
Christoph HellwigKAGA-KOKO
authored andcommitted
blk-mq: Include all present CPUs in the default queue mapping
This way we get a nice distribution independent of the current cpu online / offline state. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jens Axboe <axboe@kernel.dk> Cc: Keith Busch <keith.busch@intel.com> Cc: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org Link: http://lkml.kernel.org/r/20170626102058.10200-2-hch@lst.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent bf22ff4 commit 5f042e7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

block/blk-mq-cpumap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ int blk_mq_map_queues(struct blk_mq_tag_set *set)
3535
{
3636
unsigned int *map = set->mq_map;
3737
unsigned int nr_queues = set->nr_hw_queues;
38-
const struct cpumask *online_mask = cpu_online_mask;
3938
unsigned int i, nr_cpus, nr_uniq_cpus, queue, first_sibling;
4039
cpumask_var_t cpus;
4140

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

4544
cpumask_clear(cpus);
4645
nr_cpus = nr_uniq_cpus = 0;
47-
for_each_cpu(i, online_mask) {
46+
for_each_present_cpu(i) {
4847
nr_cpus++;
4948
first_sibling = get_first_sibling(i);
5049
if (!cpumask_test_cpu(first_sibling, cpus))
@@ -54,7 +53,7 @@ int blk_mq_map_queues(struct blk_mq_tag_set *set)
5453

5554
queue = 0;
5655
for_each_possible_cpu(i) {
57-
if (!cpumask_test_cpu(i, online_mask)) {
56+
if (!cpumask_test_cpu(i, cpu_present_mask)) {
5857
map[i] = 0;
5958
continue;
6059
}

0 commit comments

Comments
 (0)