From: Nilay Shroff <nilay@linux.ibm.com>
To: axboe@kernel.dk, mt4022@columbia.edu, hch@lst.de,
mkhalfella@purestorage.com, bvanassche@acm.org,
kbusch@kernel.org, josef@toxicpanda.com, tom.leiming@gmail.com,
tz2294@columbia.edu, gjoyce@linux.ibm.com
Cc: linux-block@vger.kernel.org, Nilay Shroff <nilay@linux.ibm.com>
Subject: [PATCH 1/3] block: remove RCU protection for tag_set_list
Date: Thu, 3 Dec 2026 20:52:37 +0530 [thread overview]
Message-ID: <20261203152318.654390-6-nilay@linux.ibm.com> (raw)
In-Reply-To: <20261203152318.654390-5-nilay@linux.ibm.com>
Commit 495f22c5a99a ("blk-mq: take quiesce_lock when removing a queue
from the tag set") ensures that set->quiesce_lock serialize both
traversals of set->tag_list in blk_mq_[un]quiesce_tagset() and
modifications to the list in blk_mq_[add|del]_queue_tag_set().
With both list traversal and modification now serialized by
set->quiesce_lock, RCU protection is no longer necessary for these
operations.
Replace the RCU-protected list APIs with their non-RCU counterparts
and remove the unnecessary RCU read-side critical sections from
blk_mq_[un]quiesce_tagset().
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
---
block/blk-mq.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 54ccfc43c27c..b3d26f0ec1a7 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -338,12 +338,10 @@ void blk_mq_quiesce_tagset(struct blk_mq_tag_set *set)
spin_lock(&set->quiesce_lock);
set->quiesce_depth++;
- rcu_read_lock();
- list_for_each_entry_rcu(q, &set->tag_list, tag_set_list) {
+ list_for_each_entry(q, &set->tag_list, tag_set_list) {
if (!blk_queue_skip_tagset_quiesce(q))
blk_mq_quiesce_queue_nowait(q);
}
- rcu_read_unlock();
spin_unlock(&set->quiesce_lock);
blk_mq_wait_quiesce_done(set);
@@ -357,12 +355,10 @@ void blk_mq_unquiesce_tagset(struct blk_mq_tag_set *set)
spin_lock(&set->quiesce_lock);
if (set->quiesce_depth)
set->quiesce_depth--;
- rcu_read_lock();
- list_for_each_entry_rcu(q, &set->tag_list, tag_set_list) {
+ list_for_each_entry(q, &set->tag_list, tag_set_list) {
if (!blk_queue_skip_tagset_quiesce(q))
blk_mq_unquiesce_queue(q);
}
- rcu_read_unlock();
spin_unlock(&set->quiesce_lock);
}
EXPORT_SYMBOL_GPL(blk_mq_unquiesce_tagset);
@@ -4354,9 +4350,8 @@ 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);
+ list_del(&q->tag_set_list);
spin_unlock(&set->quiesce_lock);
if (list_is_singular(&set->tag_list)) {
/* just transitioned to unshared */
@@ -4390,7 +4385,7 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
* and blk_mq_unquiesce_tagset() finds what it is going to undo.
*/
spin_lock(&set->quiesce_lock);
- list_add_tail_rcu(&q->tag_set_list, &set->tag_list);
+ list_add_tail(&q->tag_set_list, &set->tag_list);
if (!blk_queue_skip_tagset_quiesce(q)) {
for (i = 0; i < set->quiesce_depth; i++)
blk_mq_quiesce_queue_nowait(q);
--
2.53.0
next prev parent reply other threads:[~2026-12-03 15:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 15:22 [PATCH 0/3] block: remove RCU protection and add context annotation Nilay Shroff
2026-12-03 15:22 ` Nilay Shroff [this message]
2026-12-03 16:41 ` [PATCH 1/3] block: remove RCU protection for tag_set_list Bart Van Assche
2026-12-03 15:22 ` [PATCH 2/3] block: remove unused blk_mq_free_sched_res_batch() Nilay Shroff
2026-12-03 16:42 ` Bart Van Assche
2026-12-03 15:22 ` [PATCH 3/3] block: add context annotations for tag_list_lock and quiesce_lock Nilay Shroff
2026-12-03 16:43 ` Bart Van Assche
2026-12-04 9:36 ` Nilay Shroff
2026-12-04 16:27 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203152318.654390-6-nilay@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=gjoyce@linux.ibm.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=mkhalfella@purestorage.com \
--cc=mt4022@columbia.edu \
--cc=tom.leiming@gmail.com \
--cc=tz2294@columbia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.