8349988: Change cgroup version detection logic to not depend on /proc/cgroups#3177
8349988: Change cgroup version detection logic to not depend on /proc/cgroups#3177jmtd wants to merge 2 commits intoopenjdk:masterfrom
Conversation
Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
|
👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issues from the original commit. |
phohensee
left a comment
There was a problem hiding this comment.
Indeed clean except for nullptr -> NULL.
|
|
|
/approval request backport of an improvement to cgroup detection logic. important for newer kernels which do not populate /proc/cgroups with the required information. not clean, small number of fixups in second commit. |
|
/reviewers 2 reviewer |
|
@gnu-andrew |
gnu-andrew
left a comment
There was a problem hiding this comment.
This mostly looks ok. I spotted three minor issues:
- In changing the section which reads
/proc/cgroups, part of JDK-8238161: "use os::fopen in HS code where possible" is inadvertently introduced by changingcgroups = fopen(proc_cgroups, "r");toos::fopen(controllers_file, "r"). As there are no cases ofos::fopenin this file in 11u at present, I would stick withfopenhere rather than introducing a single usage while the rest of the file is usingfopen. - Around that same section, a double space in the comment after
controllersand beforeIf notis reduced to single. It would be good to keep this the same as 21u. - I was confused by the copyright header change to 2025 in
cgroupSubsystem_linux.cppfor some time. We don't generally update copyright headers as part of backports to reduce future friction, but this isn't that either; it's 2026 and only that one file is updated, while all are pre-2025 in 11u. Then I saw thefclosethat comes from JDK-8354878 along with this header change. That needs to be credited using theissuecommand.
The first two of these seem to stem from the 17u backport. I didn't realise at first that I was looking at the 25u version to compare, but I think it would still be good to fix these trivial issues here, even if we're now stuck with them in the 17u backport. Clearly I didn't look at that one closely enough at the time.
The third seems to come from the fact that you referenced the 25u commit in your 'Backport x' commit and so Skara hasn't picked up the other issue. That should be easily fixed with the appropriate issue command.
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
nullptrtoNULLsubstitutions (in the second commit).I worked from Severin's 17u backport of 8349988.
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3177/head:pull/3177$ git checkout pull/3177Update a local copy of the PR:
$ git checkout pull/3177$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3177/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3177View PR using the GUI difftool:
$ git pr show -t 3177Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3177.diff
Using Webrev
Link to Webrev Comment