]> git.ipfire.org Git - thirdparty/linux.git/commit
cgroup: Remove redundant rcu_read_lock/unlock() in spin_lock
authorpengdonglin <pengdonglin@xiaomi.com>
Tue, 16 Sep 2025 04:47:29 +0000 (12:47 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 16 Sep 2025 18:36:14 +0000 (08:36 -1000)
commit3ee4211ef8693377f67624a46b4f8577f6a495d9
tree17e0eac8b8764e5ba52c72857b98fcb1cb5f1ae4
parent0568f89d4fb82d98001baeb870e92f43cd1f7317
cgroup: Remove redundant rcu_read_lock/unlock() in spin_lock

Since commit a8bb74acd8efe ("rcu: Consolidate RCU-sched update-side function definitions")
there is no difference between rcu_read_lock(), rcu_read_lock_bh() and
rcu_read_lock_sched() in terms of RCU read section and the relevant grace
period. That means that spin_lock(), which implies rcu_read_lock_sched(),
also implies rcu_read_lock().

There is no need no explicitly start a RCU read section if one has already
been started implicitly by spin_lock().

Simplify the code and remove the inner rcu_read_lock() invocation.

Cc: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Waiman Long <longman@redhat.com>
Signed-off-by: pengdonglin <pengdonglin@xiaomi.com>
Signed-off-by: pengdonglin <dolinux.peng@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c
kernel/cgroup/debug.c