summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFanjun Kong <bh1scw@gmail.com>2022-05-16 20:39:30 +0300
committerJens Axboe <axboe@kernel.dk>2022-05-17 15:12:23 +0300
commit77c570a1ea85ba4ab135c61a028420a6e9fe77f3 (patch)
tree60306c81ebde95b65ae407be843e11b5217b47d6
parent3607849df47822151b05df440759e2dc70160755 (diff)
downloadlinux-77c570a1ea85ba4ab135c61a028420a6e9fe77f3.tar.xz
blk-cgroup: Remove unnecessary rcu_read_lock/unlock()
spin_lock_irq/spin_unlock_irq contains preempt_disable/enable(). Which can serve as RCU read-side critical region, so remove rcu_read_lock/unlock(). Signed-off-by: Fanjun Kong <bh1scw@gmail.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20220516173930.159535-1-bh1scw@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-cgroup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 204442fad33c..0676cf7a41b5 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1278,14 +1278,13 @@ int blkcg_init_queue(struct request_queue *q)
preloaded = !radix_tree_preload(GFP_KERNEL);
/* Make sure the root blkg exists. */
- rcu_read_lock();
+ /* spin_lock_irq can serve as RCU read-side critical section. */
spin_lock_irq(&q->queue_lock);
blkg = blkg_create(&blkcg_root, q, new_blkg);
if (IS_ERR(blkg))
goto err_unlock;
q->root_blkg = blkg;
spin_unlock_irq(&q->queue_lock);
- rcu_read_unlock();
if (preloaded)
radix_tree_preload_end();
@@ -1311,7 +1310,6 @@ err_destroy_all:
return ret;
err_unlock:
spin_unlock_irq(&q->queue_lock);
- rcu_read_unlock();
if (preloaded)
radix_tree_preload_end();
return PTR_ERR(blkg);