Skip to content

Commit ec30b46

Browse files
Ming Leiaxboe
authored andcommitted
blk-mq: don't change nr_hw_queues and nr_maps for kdump kernel
For most of ARCHs, 'nr_cpus=1' is passed for kdump kernel, so nr_hw_queues for each mapping is supposed to be 1 already. More importantly, this way may cause trouble for driver, because blk-mq and driver see different queue mapping since driver should setup hardware queue setting before calling into allocating blk-mq tagset. So not overriding nr_hw_queues and nr_maps for kdump kernel. Cc: Wen Xiong <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent fb5d1d3 commit ec30b46

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

block/blk-mq.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4379,7 +4379,7 @@ static void blk_mq_update_queue_map(struct blk_mq_tag_set *set)
43794379
if (set->nr_maps == 1)
43804380
set->map[HCTX_TYPE_DEFAULT].nr_queues = set->nr_hw_queues;
43814381

4382-
if (set->ops->map_queues && !is_kdump_kernel()) {
4382+
if (set->ops->map_queues) {
43834383
int i;
43844384

43854385
/*
@@ -4478,14 +4478,12 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
44784478

44794479
/*
44804480
* If a crashdump is active, then we are potentially in a very
4481-
* memory constrained environment. Limit us to 1 queue and
4482-
* 64 tags to prevent using too much memory.
4481+
* memory constrained environment. Limit us to 64 tags to prevent
4482+
* using too much memory.
44834483
*/
4484-
if (is_kdump_kernel()) {
4485-
set->nr_hw_queues = 1;
4486-
set->nr_maps = 1;
4484+
if (is_kdump_kernel())
44874485
set->queue_depth = min(64U, set->queue_depth);
4488-
}
4486+
44894487
/*
44904488
* There is no use for more h/w queues than cpus if we just have
44914489
* a single map
@@ -4515,7 +4513,7 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
45154513
GFP_KERNEL, set->numa_node);
45164514
if (!set->map[i].mq_map)
45174515
goto out_free_mq_map;
4518-
set->map[i].nr_queues = is_kdump_kernel() ? 1 : set->nr_hw_queues;
4516+
set->map[i].nr_queues = set->nr_hw_queues;
45194517
}
45204518

45214519
blk_mq_update_queue_map(set);

0 commit comments

Comments
 (0)