linux/kernel/cgroup
Tejun Heo b4ff1b44bc 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>
2019-02-15 11:01:31 -08:00
..
cgroup-internal.h cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug 2018-11-08 12:27:32 -08:00
cgroup-v1.c cgroup: Add named hierarchy disabling to cgroup_no_v1 boot param 2018-12-28 10:34:12 -08:00
cgroup.c cgroup/pids: turn cgroup_subsys->free() into cgroup_subsys->release() to fix the accounting 2019-01-31 06:55:57 -08:00
cpuset.c Merge branch 'for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2018-12-29 10:57:20 -08:00
debug.c cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug 2018-11-08 12:27:32 -08:00
freezer.c cgroup: add @flags to css_task_iter_start() and implement CSS_TASK_ITER_PROCS 2017-07-21 11:14:51 -04:00
Makefile cgroup: Rename kernel/cgroup/stat.c to kernel/cgroup/rstat.c 2018-04-26 14:29:04 -07:00
namespace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pids.c cgroup/pids: turn cgroup_subsys->free() into cgroup_subsys->release() to fix the accounting 2019-01-31 06:55:57 -08:00
rdma.c rdmacg: Convert to use match_string() helper 2018-05-07 09:27:26 -07:00
rstat.c cgroup, rstat: Don't flush subtree root unless necessary 2019-02-15 11:01:31 -08:00