diff options
author | Tejun Heo <tj@kernel.org> | 2019-02-15 11:01:31 -0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2019-02-15 11:01:31 -0800 |
commit | b4ff1b44bcd384d22fcbac6ebaf9cc0d33debe50 (patch) | |
tree | 3f0aea15805e400a195b38bb98418e615b9cf86e /kernel/exit.c | |
parent | 05b71f6ffd182e3af3ac25ab811675d622d4ac2a (diff) | |
download | linux-b4ff1b44bcd384d22fcbac6ebaf9cc0d33debe50.tar.bz2 |
cgroup, rstat: Don't flush subtree root unless necessary
cgroup_rstat_cpu_pop_updated() is used to traverse the updated cgroups
on flush. While it was only visiting updated ones in the subtree, it
was visiting @root unconditionally. We can easily check whether @root
is updated or not by looking at its ->updated_next just as with the
cgroups in the subtree.
* Remove the unnecessary cgroup_parent() test. The system root cgroup
is never updated and thus its ->updated_next is always NULL. No
need to test whether cgroup_parent() exists in addition to
->updated_next.
* Terminate traverse if ->updated_next is NULL. This can only happen
for subtree @root and there's no reason to visit it if it's not
marked updated.
This reduces cpu consumption when reading a lot of rstat backed files.
In a micro benchmark reading stat from ~1600 cgroups, the sys time was
lowered by >40%.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/exit.c')
0 files changed, 0 insertions, 0 deletions