Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgroupv1: check that cpuset and memory controllers are exported
kernel v6.11 introduced new CONFIG_MEMCG_V1 and CONFIG_CPUSETS_V1 [1] that changed how userspace detects the compiled cgroup controllers, if the new CONFIG_MEMCG_V1=n is not set then the memory and same for cpuset controller will not be exported in /proc/cgroups. Update parseCgroupv1SubSysIds() that parses cgroup controllers to ensure that we have the memory and cpuset controllers compiled and exported, and in case of failures report that the user needs kernel configs: CONFIG_MEMCG=y and CONFIG_MEMCG_V1=y CONFIG_CPUSETS=y and CONFIG_CPUSETS_V1=y We need them to be compiled and exported in /proc/cgroups since we use the line order and number as an indication for their index in the css_set to fetch the related subsystem and its cgroup. They are compiled in configs, same for /proc/cgroups since its content is compile time generated. That index allows us to work and track the right cgroup hierarchy in cgroupv1 otherwise we will operate on the wrong hierarchy that probably does not have proper cgroup tracking. The css_set index is saved in the bpf map 'tg_conf_map' in field tg_cgrpv1_subsys_idx from user space during startup, and used later by bpf code to track processes and associate related cgroups. [1] "af000ce85293b8e60" "cgroup: Do not report unavailable v1 controllers in /proc/cgroups" Signed-off-by: Djalal Harouni <[email protected]>
- Loading branch information