Skip to content

8349988: Change cgroup version detection logic to not depend on /proc/cgroups#779

Draft
jmtd wants to merge 4 commits intoopenjdk:masterfrom
jmtd:8349988-8u
Draft

8349988: Change cgroup version detection logic to not depend on /proc/cgroups#779
jmtd wants to merge 4 commits intoopenjdk:masterfrom
jmtd:8349988-8u

Conversation

@jmtd
Copy link
Copy Markdown
Contributor

@jmtd jmtd commented Mar 24, 2026

Note: this adapts the 11u backport which (at the time of writing) is not yet approved.

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/cgroups file with necessary controllers.

This wasn't clean: there are a few C++ changes (nullptr to NULL substitutions, os namespacing on cstd functions); logging mechanism changes; removal of PID controller related stuff.

Cherry-picking note: for reasons unknown git failed to apply the hunks for whitebox.cpp so I did those manually. It also patched the wrong copy of WhiteBox.java. I'm hoping we can pick up JDK-8327993 which should resolve this for future cgroups backports.

The modified CgroupSubsystemFactory.java passes.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8347811 needs maintainer approval
  • JDK-8349988 needs maintainer approval

Issues

  • JDK-8349988: Change cgroup version detection logic to not depend on /proc/cgroups (Sub-task - P3)
  • JDK-8347811: Container detection code for cgroups v2 should use cgroup.controllers (Enhancement - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/779/head:pull/779
$ git checkout pull/779

Update a local copy of the PR:
$ git checkout pull/779
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/779/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 779

View PR using the GUI difftool:
$ git pr show -t 779

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/779.diff

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 24, 2026

👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 24, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 24, 2026

⚠️ @jmtd the commit 59c7c8ed4b3392d3c8ee26128aaa71d10f46a595 does not refer to an issue in project JDK.

jerboaa and others added 3 commits March 24, 2026 13:48
…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>
@jmtd jmtd changed the title Backport 59c7c8ed4b3392d3c8ee26128aaa71d10f46a595 Backport dd842c440e3f50028fc991b29ea096f0e64e967b Mar 24, 2026
@openjdk openjdk bot changed the title Backport dd842c440e3f50028fc991b29ea096f0e64e967b 8349988: Change cgroup version detection logic to not depend on /proc/cgroups Mar 24, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 24, 2026

This backport pull request has now been updated with issues from the original commit.

@openjdk openjdk bot added the backport Port of a pull request already in a different code base label Mar 24, 2026
@jmtd
Copy link
Copy Markdown
Contributor Author

jmtd commented Mar 24, 2026

# newfailures.txt
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#digicerttlseccrootg5 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#digicerttlsrsarootg5 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca1g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca2g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca3g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#teliarootcav2 

gut feeling is these will be unrelated but I will investigate further.

@jmtd
Copy link
Copy Markdown
Contributor Author

jmtd commented Mar 24, 2026

reproduced those failures locally. now trying the master branch. Edit: yes same failures

@gnu-andrew
Copy link
Copy Markdown
Member

# newfailures.txt
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#digicerttlseccrootg5 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#digicerttlsrsarootg5 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca1g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca2g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#quovadisrootca3g3 
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#teliarootcav2 

gut feeling is these will be unrelated but I will investigate further.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base

Development

Successfully merging this pull request may close these issues.

3 participants