]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: Fix changing the number of hardware queues
authorBart Van Assche <bvanassche@acm.org>
Tue, 10 Mar 2020 04:26:20 +0000 (21:26 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Mar 2020 13:09:59 +0000 (07:09 -0600)
commit725224d93da4648c4b1467f448385a79f6f0b67c
tree857307a3b625ba46156900e6c6f32b958fe7b1ad
parent9963340261bc89d9c80f3c75dc69ace8f5c0eeb1
null_blk: Fix changing the number of hardware queues

Instead of initializing null_blk hardware queues explicitly after the
request queue has been created, provide .init_hctx() and .exit_hctx()
callback functions. The latter functions are not only called during
request queue allocation but also when the number of hardware queues
changes. Allocate nr_cpu_ids queues during initialization to support
increasing the number of hardware queues above the initial hardware
queue count.

This change fixes increasing the number of hardware queues above the
initial number of hardware queues and also keeps nullb->nr_queues in
sync with the number of hardware queues.

Fixes: 7da28d427808 ("null_blk: Enable modifying 'submit_queues' after an instance has been configured")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk_main.c