8349988: Change cgroup version detection logic to not depend on /proc/cgroups#779
8349988: Change cgroup version detection logic to not depend on /proc/cgroups#779jmtd wants to merge 8 commits into
Conversation
|
👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
…71d10f46a595 For whatever reason, `git cherry-pick` could not resolve the path to whitebox.cpp in 8u and didn't apply the changes. Here they are. This wasn't clean: the `validate_cgroup` change had context differences. I've opted to incorporate 11u's use of CG_INFO_LENGTH for cg_infos. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
remove reference to pids controller remove os namespacing of fopen replace log_debug with tty->print_cr Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
This backport pull request has now been updated with issues from the original commit. |
gut feeling is these will be unrelated but I will investigate further. |
|
reproduced those failures locally. now trying the master branch. Edit: yes same failures |
They are. I haven't looked at this one in detail yet, but I would wait until the 11u one is in, as I did spot a few issues with that one. |
Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
Local testing: hotspot/test/runtime/containers/cgroup/CgroupSubsystemFactory.java passes. Manual check: before: after: |
Webrevs
|
|
Mailing list message from Jonathan Dowland on jdk8u-dev: On Fri May 8, 2026 at 10:45 AM BST, Andrew John Hughes wrote: Skara has posted Andrew's comment today in response to me marking the PR This is finally RFR from my POV: GHA tests pass (all bar windows/x84 Thanks, -- |
|
@jmtd This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
/touch Still RFR. Thanks! |
|
@jmtd The pull request is being re-evaluated and the inactivity timeout has been reset. |
jerboaa
left a comment
There was a problem hiding this comment.
A few things need some touch-ups IMO. Let me know what you think.
| // cpuset might not be enabled on newer Linux distros (Fedora 41) | ||
| bool all_required_controllers_enabled = true; |
There was a problem hiding this comment.
This comment about cpuset is about JDK-8347129 which isn't in 8u. Perhaps this should get added - with /issue add - as after this patch it's essentially optional.
| if (i == CPUSET_IDX && PrintContainerInfo) { | ||
| tty->print_cr("Detected optional %s controller entry in %s", | ||
| controller, controllers_file); |
| sysFsCgroupCgroupControllersNoPidsPath = Paths.get(existingDirectory.toString(), "sys_fs_cgroup_cgroup_controllers_no_pids"); | ||
| Files.write(sysFsCgroupCgroupControllersNoPidsPath, sysFsCgroupCgroupControllersNoPidsContent.getBytes(StandardCharsets.UTF_8)); |
There was a problem hiding this comment.
With the pids controller support not present. I'm doubtful this should be included as a test.
| public native int validateCgroup(boolean cgroupsV2Enabled, | ||
| String controllersFile, | ||
| String procSelfCgroup, | ||
| String procSelfMountinfo); | ||
| public native void printOsInfo(); | ||
| public native int validateCgroup(String procCgroups, | ||
| String procSelfCgroup, | ||
| String procSelfMountinfo); |
There was a problem hiding this comment.
The public native int validateCgroup() native method should only be there once. It's there twice with different signatures.
Co-authored-by: Severin Gehwolf <jerboaa@gmail.com>
|
/issue add JDK-8354878 |
|
@jmtd |
Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
/issue add JDK-8347129 |
|
@jmtd |
This is a backport of an improvement to cgroup detection logic. This fixes mis-detection on some systems e.g. Debian and Ubuntu systems, or systems running a recent enough mainline kernel which no longer propagates the older
/proc/cgroupsfile with necessary controllers.This wasn't clean: there are a few C++ changes (
nullptrtoNULLsubstitutions,osnamespacing on cstd functions); logging mechanism changes; removal of PID controller related stuff.Cherry-picking note: for reasons unknown
gitfailed to apply the hunks forwhitebox.cppso I did those manually. It also patched the wrong copy ofWhiteBox.java. I'm hoping we can pick up JDK-8327993 which should resolve this for future cgroups backports.The modified
CgroupSubsystemFactory.javapasses.Progress
Issues
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/779/head:pull/779$ git checkout pull/779Update a local copy of the PR:
$ git checkout pull/779$ git pull https://git.openjdk.org/jdk8u-dev.git pull/779/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 779View PR using the GUI difftool:
$ git pr show -t 779Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/779.diff
Using Webrev
Link to Webrev Comment