blk-mq: Relocate shared sbitmap resize in blk_mq_update_nr_requests()
authorJohn Garry <john.garry@huawei.com>
Tue, 5 Oct 2021 10:23:28 +0000 (18:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:02 +0000 (06:17 -0600)
commit8fa044640f128c0cd015f72cda42989a664889fc
tree62e6eeef92eaa7a9b23a9577bae751257b0bf85c
parentd2a27964e60ff18e637334864042af54de383902
blk-mq: Relocate shared sbitmap resize in blk_mq_update_nr_requests()

For shared sbitmap, if the call to blk_mq_tag_update_depth() was
successful for any hctx when hctx->sched_tags is not set, then it would be
successful for all (due to nature in which blk_mq_tag_update_depth()
fails).

As such, there is no need to call blk_mq_tag_resize_shared_sbitmap() for
each hctx. So relocate the call until after the hctx iteration under the
!q->elevator check, which is equivalent (to !hctx->sched_tags).

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/1633429419-228500-4-git-send-email-john.garry@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c