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 --- 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