]> git.proxmox.com Git - mirror_lxcfs.git/commit - src/cgroups/cgroup.c
cgroups: more cgroup2 fun
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 17 Apr 2020 10:20:55 +0000 (12:20 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 17 Apr 2020 13:16:14 +0000 (15:16 +0200)
commit114eb8b83b51e4ab1d9f9a48441a5efd1c897eef
treef47b76cd05529ba8392df4b5d864c6cd55503941
parent401b35365a5cd937a342c17fc6e157b8b11d0f8b
cgroups: more cgroup2 fun

Try too read a valid value from a given cgroup file. If it is a legacy
cgroup hierarchy and we fail to find a valid value we terminate early
and report an error.
The cgroup2 hierarchy however, has different semantics. In a few
controller files it will show the value "max" or simply leave it
completely empty thereby indicating that no limit has been set for this
particular cgroup.  However, that doesn't mean that there's no limit. A
cgroup further up the hierarchy could have a limit set that also applies
to the cgroup we are interested in. So for the unified cgroup hierarchy
we need to keep walking towards the cgroup2 root cgroup and try to parse
a valid value.

Fixes: #389.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/cgroups/cgfsng.c
src/cgroups/cgroup.c
src/cgroups/cgroup.h
src/cgroups/cgroup_utils.c
src/cgroups/cgroup_utils.h
src/proc_fuse.c