Re: [PATCH] blk-mq: take quiesce_lock when removing a queue from the tag set
From: Nilay Shroff
Date: Wed Nov 04 2026 - 08:24:24 EST
On 11/4/26 12:34 AM, Mani Tofigh via B4 Relay wrote:
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5ae22d556540..54ccfc43c27c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4354,7 +4354,10 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q)
lockdep_assert_held(&set->tag_list_lock);
+ /* blk_mq_unquiesce_tagset() runs the hctxs, which are not RCU freed */
+ spin_lock(&set->quiesce_lock);
list_del_rcu(&q->tag_set_list);
+ spin_unlock(&set->quiesce_lock);
if (list_is_singular(&set->tag_list)) {
/* just transitioned to unshared */
set->flags &= ~BLK_MQ_F_TAG_QUEUE_SHARED;
Now that set->quiesce_lock serializes both traversal of set->tag_list
in blk_mq_[un]quiesce_tagset() as well as modifications in
blk_mq_[add|del]_queue_tag_set(), do we still need RCU protection for
this list?
Assuming there are no other lockless readers of set->tag_list, could we
use regular list operations in blk_mq_[add|del]_queue_tag_set() and remove
the RCU read-side critical sections from blk_mq_[un]quiesce_tagset()?
Thanks,
--Nilay