cgroup: move rstat base stat objects into their own struct
authorJP Kobryn <inwardvessel@gmail.com>
Fri, 4 Apr 2025 01:10:46 +0000 (18:10 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 4 Apr 2025 20:00:53 +0000 (10:00 -1000)
commitf6e9a26e2d488c743757d66898ae91c53ffbe528
tree0ef76e66c45ff6824f2f14691c2b98021b55b407
parenta22b3d54de94f82ca057cc2ebf9496fa91ebf698
cgroup: move rstat base stat objects into their own struct

This non-functional change serves as preparation for moving to
subsystem-based rstat trees. The base stats are not an actual subsystem,
but in future commits they will have exclusive rstat trees just as other
subsystems will.

Moving the base stat objects into a new struct allows the cgroup_rstat_cpu
struct to become more compact since it now only contains the minimum amount
of pointers needed for rstat participation. Subsystems will (in future
commits) make use of the compact cgroup_rstat_cpu struct while avoiding the
memory overhead of the base stat objects which they will not use.

An instance of the new struct cgroup_rstat_base_cpu was placed on the
cgroup struct so it can retain ownership of these base stats common to all
cgroups. A helper function was added for looking up the cpu-specific base
stats of a given cgroup. Finally, initialization and variable names were
adjusted where applicable.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup-defs.h
kernel/cgroup/cgroup.c
kernel/cgroup/rstat.c