Skip to content
Commit 093c8812 authored by Yosry Ahmed's avatar Yosry Ahmed Committed by Tejun Heo
Browse files

cgroup: rstat: Cleanup flushing functions and locking



Now that the rstat lock is being re-acquired on every CPU iteration in
cgroup_rstat_flush_locked(), having the initially acquire the lock is
unnecessary and unclear.

Inline cgroup_rstat_flush_locked() into cgroup_rstat_flush() and move
the lock/unlock calls to the beginning and ending of the loop body to
make the critical section obvious.

cgroup_rstat_flush_hold/release() do not make much sense with the lock
being dropped and reacquired internally. Since it has no external
callers, remove it and explicitly acquire the lock in
cgroup_base_stat_cputime_show() instead.

This leaves the code with a single flushing function,
cgroup_rstat_flush().

Signed-off-by: default avatarYosry Ahmed <yosry.ahmed@linux.dev>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 0efc297a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment