Skip to contentSkip to conversation

blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long

PATCH Applied Bart Van Assche 4 participants 4 messages Oct 22, 2024 – Oct 23, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blk-mq: Make blk_mq_quiesce_tagset() hold the tag list mutex less long

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.

Cc Chao Leng <[email protected]>
Cc Ming Lei <[email protected]>
Fixes commit 414dd48e882c ("blk-mq: add tagset quiesce interface")
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-mq.c +2 -1
index 4b2c8e940f59..1ef227dfb9ba 100644
@@ -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);
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Bart Van Assche

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.

maintainer Applied
#2 lore raw
In reply to Bart Van Assche
Quoted 6 lines · Bart Van Assche

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,

Signature · 1 line
Jens Axboe
Reviewed-by on v1 1/1
#3 lore raw
In reply to Bart Van Assche
Quoted 11 lines · Bart Van Assche

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.

Cc Chao Leng <[email protected]>
Cc Ming Lei <[email protected]>
Fixes commit 414dd48e882c ("blk-mq: add tagset quiesce interface")

Thanks,
Ming