]> git.baikalelectronics.ru Git - kernel.git/commit
block: update hctx map when use multiple maps
authorWeiping Zhang <zhangweiping@didiglobal.com>
Wed, 17 Jun 2020 06:18:37 +0000 (14:18 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Jun 2020 03:33:04 +0000 (21:33 -0600)
commit313e08fe6706fc1b1f05ac652afcc3c14c6e843d
tree57b317c47c08da4ddcc8e178e3ac7a5567f3f8b6
parent64191d958b59d5109df29dd35bf70b21d0260b36
block: update hctx map when use multiple maps

There is an issue when tune the number for read and write queues,
if the total queue count was not changed. The hctx->type cannot
be updated, since __blk_mq_update_nr_hw_queues will return directly
if the total queue count has not been changed.

Reproduce:

dmesg | grep "default/read/poll"
[    2.607459] nvme nvme0: 48/0/0 default/read/poll queues
cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c
     48 default

tune the write queues to 24:
echo 24 > /sys/module/nvme/parameters/write_queues
echo 1 > /sys/block/nvme0n1/device/reset_controller

dmesg | grep "default/read/poll"
[  433.547235] nvme nvme0: 24/24/0 default/read/poll queues

cat /sys/kernel/debug/block/nvme0n1/hctx*/type | sort | uniq -c
     48 default

The driver's hardware queue mapping is not same as block layer.

Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c