RFR: 8349988: Change cgroup version detection logic to not depend on /proc/cgroups
Thomas Fitzsimmons
duke at openjdk.org
Fri Feb 28 12:50:02 UTC 2025
On Fri, 28 Feb 2025 09:37:29 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 339:
>>
>>> 337: cg_infos[MEMORY_IDX]._enabled = (enabled == 1);
>>> 338: } else if (strcmp(name, "cpuset") == 0) {
>>> 339: log_debug(os, container)("Detected optional cpuset controller entry in %s", controllers_file);
>>
>> In https://bugs.openjdk.org/browse/JDK-8347129 we decided to keep the `cpuset` optionality alone for cg v1. I'd prefer if we kept it that way as it's becoming increasingly difficult to find those systems (or change them). Thus, hard to know if this would break something.
>
> Update: Please remove the log line, since this is the cg v1 branch and there cpuset isn't optional.
OK, will do. This represents a change to debug logging on `RHEL-8`, at least in my default test configuration. Currently it is, with and without my patch:
$ jdk/bin/java -Xlog:os+container=trace -version
[0.001s][trace][os,container] OSContainer::init: Initializing Container Support
[0.001s][debug][os,container] Detected optional cpuset controller entry in /proc/cgroups
[0.001s][debug][os,container] Detected optional pids controller entry in /proc/cgroups
[0.001s][debug][os,container] Detected cgroups hybrid or legacy hierarchy, using cgroups v1 controllers
[...]
However, I agree that the change is a good one, since the debug message was inaccurate when the system was ultimately determined to be in `cgroups v1` mode.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23811#discussion_r1975354075
More information about the hotspot-dev
mailing list