]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: don't clear flush_rq from tags->rqs[]
authorMing Lei <ming.lei@redhat.com>
Thu, 16 Jun 2022 01:44:01 +0000 (09:44 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Jun 2022 20:45:15 +0000 (14:45 -0600)
commit6302a536a052db1a8ff973b8af5bf2f44ffbbbe9
treeedb82888efd3a884207c640f88837f5ab11fa0f3
parent13010159a8516c5b382911c3b84176dd09879b2e
blk-mq: don't clear flush_rq from tags->rqs[]

commit 3ff8e237de54 ("blk-mq: clearing flush request reference in
tags->rqs[]") is added to clear the to-be-free flush request from
tags->rqs[] for avoiding use-after-free on the flush rq.

Yu Kuai reported that blk_mq_clear_flush_rq_mapping() slows down boot time
by ~8s because running scsi probe which may create and remove lots of
unpresent LUNs on megaraid-sas which uses BLK_MQ_F_TAG_HCTX_SHARED and
each request queue has lots of hw queues.

Improve the situation by not running blk_mq_clear_flush_rq_mapping if
disk isn't added when there can't be any flush request issued.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reported-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220616014401.817001-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c