diff options
| author | Bart Van Assche <bvanassche@acm.org> | 2024-10-22 11:16:17 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:02:56 +0100 |
| commit | aeb420ebdff41d61255c9aef8cecf7a4af087867 (patch) | |
| tree | 7fae73ebbb0cfc8503c5ac4d0cda6d593a053a1d | |
| parent | 4170346747d141a08e6b56c94380b084ecdf82f7 (diff) | |
| download | linux-aeb420ebdff41d61255c9aef8cecf7a4af087867.tar.gz linux-aeb420ebdff41d61255c9aef8cecf7a4af087867.tar.bz2 linux-aeb420ebdff41d61255c9aef8cecf7a4af087867.zip | |
blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
commit ccd9e252c515ac5a3ed04a414c95d1307d17f159 upstream.
Make sure that the tag_list_lock mutex is not held any longer than
necessary. This change reduces latency if e.g. blk_mq_quiesce_tagset()
is called concurrently from more than one thread. This function is used
by the NVMe core and also by the UFS driver.
Reported-by: Peter Wang <peter.wang@mediatek.com>
Cc: Chao Leng <lengchao@huawei.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 414dd48e882c ("blk-mq: add tagset quiesce interface")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20241022181617.2716173-1-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | block/blk-mq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index a869f5184dd2..fbd63d189c74 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -283,8 +283,9 @@ void blk_mq_quiesce_tagset(struct blk_mq_tag_set *set) if (!blk_queue_skip_tagset_quiesce(q)) blk_mq_quiesce_queue_nowait(q); } - blk_mq_wait_quiesce_done(set); mutex_unlock(&set->tag_list_lock); + + blk_mq_wait_quiesce_done(set); } EXPORT_SYMBOL_GPL(blk_mq_quiesce_tagset); |
