* [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
@ 2024-10-22 18:16 Bart Van Assche
2024-10-22 20:08 ` Keith Busch
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2024-10-22 18:16 UTC (permalink / raw)
To: Jens Axboe
Cc: linux-block, Christoph Hellwig, Bart Van Assche, Peter Wang,
Chao Leng, Ming Lei, stable
Make sure that the tag_list_lock mutex is no longer held 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: commit 414dd48e882c ("blk-mq: add tagset quiesce interface")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
block/blk-mq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4b2c8e940f59..1ef227dfb9ba 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);
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
2024-10-22 18:16 [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long Bart Van Assche
@ 2024-10-22 20:08 ` Keith Busch
2024-10-22 22:25 ` Jens Axboe
2024-10-23 2:15 ` Ming Lei
2 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2024-10-22 20:08 UTC (permalink / raw)
To: Bart Van Assche
Cc: Jens Axboe, linux-block, Christoph Hellwig, Peter Wang, Chao Leng,
Ming Lei, stable
On Tue, Oct 22, 2024 at 11:16:17AM -0700, Bart Van Assche wrote:
> Make sure that the tag_list_lock mutex is no longer held 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.
Looks good to me.
Reviewed-by: Keith Busch <kbusch@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
2024-10-22 18:16 [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long Bart Van Assche
2024-10-22 20:08 ` Keith Busch
@ 2024-10-22 22:25 ` Jens Axboe
2024-10-23 2:15 ` Ming Lei
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2024-10-22 22:25 UTC (permalink / raw)
To: Bart Van Assche
Cc: linux-block, Christoph Hellwig, Peter Wang, Chao Leng, Ming Lei,
stable
On Tue, 22 Oct 2024 11:16:17 -0700, Bart Van Assche wrote:
> Make sure that the tag_list_lock mutex is no longer held 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.
>
>
Applied, thanks!
[1/1] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
commit: 6fbd7e0472b73bc21b19d56d3f95c2a1a5456607
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long
2024-10-22 18:16 [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long Bart Van Assche
2024-10-22 20:08 ` Keith Busch
2024-10-22 22:25 ` Jens Axboe
@ 2024-10-23 2:15 ` Ming Lei
2 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2024-10-23 2:15 UTC (permalink / raw)
To: Bart Van Assche
Cc: Jens Axboe, linux-block, Christoph Hellwig, Peter Wang, Chao Leng,
stable
On Tue, Oct 22, 2024 at 11:16:17AM -0700, Bart Van Assche wrote:
> Make sure that the tag_list_lock mutex is no longer held 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: commit 414dd48e882c ("blk-mq: add tagset quiesce interface")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-23 2:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22 18:16 [PATCH] blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long Bart Van Assche
2024-10-22 20:08 ` Keith Busch
2024-10-22 22:25 ` Jens Axboe
2024-10-23 2:15 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).