]> Gentwo Git Trees - linux/.git/commit
blk-mq: Move flush queue allocation into blk_mq_init_hctx()
authorMing Lei <ming.lei@redhat.com>
Sat, 30 Aug 2025 02:18:19 +0000 (10:18 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 8 Sep 2025 14:05:32 +0000 (08:05 -0600)
commitaba19ee71cd7c0253612d6a2a0b3a828ba9ece29
tree5e2b76303339852a329ef4ce32d92d33ce78ba00
parentba28afbd9eff2a6370f23ef4e6a036ab0cfda409
blk-mq: Move flush queue allocation into blk_mq_init_hctx()

Move flush queue allocation into blk_mq_init_hctx() and its release into
blk_mq_exit_hctx(), and prepare for replacing tags->lock with SRCU to
draining inflight request walking. blk_mq_exit_hctx() is the last chance
for us to get valid `tag_set` reference, and we need to add one SRCU to
`tag_set` for freeing flush request via call_srcu().

It is safe to move flush queue & request release into blk_mq_exit_hctx(),
because blk_mq_clear_flush_rq_mapping() clears the flush request
reference int driver tags inflight request table, meantime inflight
request walking is drained.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sysfs.c
block/blk-mq.c