]> git.baikalelectronics.ru Git - kernel.git/commit
sched/cpuacct: Optimize away RCU read lock
authorChengming Zhou <zhouchengming@bytedance.com>
Sun, 20 Feb 2022 05:14:25 +0000 (13:14 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 1 Mar 2022 15:18:38 +0000 (16:18 +0100)
commit1d02327c7315f06a22ba89248f80b541c20f8f28
tree81effaa3f69fa5c07bc23c9c0fb7899d149732af
parentff4875df8a5774b0ccf3144cace4e5f1c2a4d1f1
sched/cpuacct: Optimize away RCU read lock

Since cpuacct_charge() is called from the scheduler update_curr(),
we must already have rq lock held, then the RCU read lock can
be optimized away.

And do the same thing in it's wrapper cgroup_account_cputime(),
but we can't use lockdep_assert_rq_held() there, which defined
in kernel/sched/sched.h.

Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220220051426.5274-2-zhouchengming@bytedance.com
include/linux/cgroup.h
kernel/sched/cpuacct.c