mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
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>
This commit is contained in:
parent
3607849df4
commit
77c570a1ea
@ -1278,14 +1278,13 @@ int blkcg_init_queue(struct request_queue *q)
|
|||||||
preloaded = !radix_tree_preload(GFP_KERNEL);
|
preloaded = !radix_tree_preload(GFP_KERNEL);
|
||||||
|
|
||||||
/* Make sure the root blkg exists. */
|
/* 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);
|
spin_lock_irq(&q->queue_lock);
|
||||||
blkg = blkg_create(&blkcg_root, q, new_blkg);
|
blkg = blkg_create(&blkcg_root, q, new_blkg);
|
||||||
if (IS_ERR(blkg))
|
if (IS_ERR(blkg))
|
||||||
goto err_unlock;
|
goto err_unlock;
|
||||||
q->root_blkg = blkg;
|
q->root_blkg = blkg;
|
||||||
spin_unlock_irq(&q->queue_lock);
|
spin_unlock_irq(&q->queue_lock);
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
if (preloaded)
|
if (preloaded)
|
||||||
radix_tree_preload_end();
|
radix_tree_preload_end();
|
||||||
@ -1311,7 +1310,6 @@ int blkcg_init_queue(struct request_queue *q)
|
|||||||
return ret;
|
return ret;
|
||||||
err_unlock:
|
err_unlock:
|
||||||
spin_unlock_irq(&q->queue_lock);
|
spin_unlock_irq(&q->queue_lock);
|
||||||
rcu_read_unlock();
|
|
||||||
if (preloaded)
|
if (preloaded)
|
||||||
radix_tree_preload_end();
|
radix_tree_preload_end();
|
||||||
return PTR_ERR(blkg);
|
return PTR_ERR(blkg);
|
||||||
|
Loading…
Reference in New Issue
Block a user