-
Enhancement
-
Resolution: Unresolved
-
P3
-
17.0.15, 24, 25
-
generic
-
linux
The kernel admin guide for cgroups v2 lists the /proc/cgroups file as meaningless for cg v2:
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#deprecated-v1-core-features
"""
/proc/cgroups is meaningless for v2. Use “cgroup.controllers” or “cgroup.stat” files at the root instead
"""
The OpenJDK container detection code still uses the deprecated feature '/proc/cgroups' and should migrate to '/sys/fs/cgroup/cgroup.subtree_control' instead for cg v2 in order to detect enabled controllers.
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#controlling-controllers mentions that the 'cgroup.controllers' file lists all available controllers for a hierarchy. However, for the purposes of the JVM we are interested in *enabled* controllers for the hierarchy. In the JVM case the hierarchy is /sys/fs/cgroup. *Enabled* controllers for a hierarchy are listed in '/sys/fs/cgroup/cgroup.subtree_control' with the same format than 'cgroup.controllers' file.
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#deprecated-v1-core-features
"""
/proc/cgroups is meaningless for v2. Use “cgroup.controllers” or “cgroup.stat” files at the root instead
"""
The OpenJDK container detection code still uses the deprecated feature '/proc/cgroups' and should migrate to '/sys/fs/cgroup/cgroup.subtree_control' instead for cg v2 in order to detect enabled controllers.
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#controlling-controllers mentions that the 'cgroup.controllers' file lists all available controllers for a hierarchy. However, for the purposes of the JVM we are interested in *enabled* controllers for the hierarchy. In the JVM case the hierarchy is /sys/fs/cgroup. *Enabled* controllers for a hierarchy are listed in '/sys/fs/cgroup/cgroup.subtree_control' with the same format than 'cgroup.controllers' file.
- duplicates
-
JDK-8349527 cgroups v2 support cannot be inferred from /proc/cgroups in Linux 6.12
-
- Closed
-
- relates to
-
JDK-8346874 Linux kernel version 6.12 and newer breaks JVM container support
-
- Closed
-
- links to
-
Review(master) openjdk/jdk/23811