Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy #121

Closed
wants to merge 16 commits into from

Conversation

jmtd
Copy link
Contributor

@jmtd jmtd commented Sep 21, 2022

This is a backport of 4def210a22faaec6b47912dd314e6365ea48d28f for jdk8u-dev as part of an effort to backport cgroups v2 support.

It does not apply clean. Paths need unshuffling. A number of changes were needed for 8u support. I've structured the PR as separate commits, with each change made in a separate commit for (hopefully) ease of review.

Not all the new tests pass: TestDockerMemoryMetrics failing one, specifically:

Exception in thread "main" java.lang.RuntimeException: Memory and swap limit not equal, expected : [209715200, 1073741824], got : [209715200, 864026624]

I think this is fixed in a further patch to backport, and will confirm.


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

Issues

  • JDK-8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
  • JDK-8275713: TestDockerMemoryMetrics test fails on recent runc
  • JDK-8228585: jdk/internal/platform/cgroup/TestCgroupMetrics.java - NumberFormatException because of large long values (memory limit_in_bytes)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 121

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2022

👋 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 openjdk bot changed the title Backport 4def210a22faaec6b47912dd314e6365ea48d28f 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy Sep 21, 2022
@openjdk
Copy link

openjdk bot commented Sep 21, 2022

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

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Sep 21, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 21, 2022

Webrevs

@jmtd
Copy link
Contributor Author

jmtd commented Sep 22, 2022

I'm probably going to rebase this on #123 (8206456). I had conflicts in this backport due to that missing in 8u that I just resolved in this PR, but I've hit further conflicts in the next patch in series, so now addressing 8206456 properly (in #123).

@jmtd
Copy link
Contributor Author

jmtd commented Sep 22, 2022

I'm probably going to rebase this on #123 (8206456).

Not necessary. Sorry for the noise!

@jmtd jmtd changed the base branch from master to pr/123 September 26, 2022 08:45
@jmtd jmtd force-pushed the 8231111-jdk8u-dev branch 2 times, most recently from 8f3570f to 0ea3c60 Compare September 26, 2022 10:08
@openjdk-notifier
Copy link

@jmtd Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@jmtd
Copy link
Contributor Author

jmtd commented Sep 27, 2022

I have ended up (artificially) making this PR depend upon pr/123, so that another PR, #124, can depend upon this one and get both - it depends upon both.

@openjdk openjdk bot mentioned this pull request Oct 5, 2022
3 tasks
@openjdk-notifier openjdk-notifier bot changed the base branch from pr/123 to master October 21, 2022 16:34
@openjdk-notifier
Copy link

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout 8231111-jdk8u-dev
git fetch https://git.openjdk.org/jdk8u-dev master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. A couple of suggestions.

@jmtd
Copy link
Contributor Author

jmtd commented Nov 1, 2022

/issue add JDK-8275713

@jmtd
Copy link
Contributor Author

jmtd commented Nov 1, 2022

/issue add JDK-8228585

@openjdk
Copy link

openjdk bot commented Nov 1, 2022

@jmtd
Adding additional issue to issue list: 8275713: TestDockerMemoryMetrics test fails on recent runc.

@openjdk
Copy link

openjdk bot commented Nov 1, 2022

@jmtd
Adding additional issue to issue list: 8228585: jdk/internal/platform/cgroup/TestCgroupMetrics.java - NumberFormatException because of large long values (memory limit_in_bytes).

@jmtd jmtd changed the base branch from master to pr/127 November 4, 2022 09:55
@openjdk
Copy link

openjdk bot commented Nov 4, 2022

⚠️ @jmtd This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk-notifier
Copy link

@jmtd Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@openjdk-notifier
Copy link

@jmtd Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 30, 2022
@jerboaa
Copy link
Contributor

jerboaa commented Dec 1, 2022

@jmtd Please rebase this onto latest master. Right now it looks like changes from #127 are included here, which shouldn't be?

commit files newly introduced in 19f26f725fd (11u-dev backport of
4def210a22faaec6b47912dd314e6365ea48d28f), with paths rewritten:

  {src/java.base => jdk/src}/linux/classes/jdk/internal/platform

Files not otherwise modified for 8u compatibility yet.
rm {src/java.base => jdk/src}/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java
conflicts in import lines, 11+ have module-related imports not
applicable to 8u. Other hunks applied OK. No further inspection
performed yet.
unshuffle, rename, resolve unclean hunks although I'm not sure why they
didn't apply, they look trivial and the context is the same, will look
closer
jdk8u doesn't have java.lang.System.Logger. There's no existing logging
in place for other classes in the Metrics/platform/etc family that I can
see, so remove it.
two files had fairly significant merge conflicts, eyeball only to resolve

haven't run any of them yet -- will depend on the rest of the patch
…recent runc

The main hunk from 8275713 was rolled up in the changes for 8231111.
This line is also necessary.
jdk8u does not have Arrays.compare()
We need the testlibrary copy of FileUtils but the test.lib.util copy of
Utils (method createTempDirectory is missing from the testlib copy)
@jmtd
Copy link
Contributor Author

jmtd commented Dec 1, 2022

@jmtd Please rebase this onto latest master. Right now it looks like changes from #127 are included here, which shouldn't be?

Done.

@openjdk
Copy link

openjdk bot commented Dec 1, 2022

@jmtd Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

Copy link
Member

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok, though again I don't see why two additional changes have been mixed in with this backport, when they could have been in follow-ups. Thanks to @jerboaa for catching that they were in there.

Approved for 8u.

@jmtd
Copy link
Contributor Author

jmtd commented Dec 5, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Dec 5, 2022

Going to push as commit c9007cd.
Since your change was applied there have been 8 commits pushed to the master branch:

  • 5510145: 8226236: win32: gc/metaspace/TestCapacityUntilGCWrapAround.java fails
  • 77403ed: 8286624: Regression Test CoordinateTruncationBug.java fails on OL8.3
  • 8356d04: 8295982: Failure in sun/security/tools/keytool/WeakAlg.java - ks: The process cannot access the file because it is being used by another process
  • fcd3c9c: 8247676: vcruntime140_1.dll is not needed on 32-bit Windows
  • 1ec7984: 8242468: VS2019 build missing vcruntime140_1.dll
  • 918a2ab: 8241087: Build failure with VS 2019 (16.5.0) due to C2039 and C2873
  • 7b54850: 8297329: [8u] hotspot needs to recognise VS2019
  • e9acfce: 8295322: Tests for JDK-8271459 were not backported to 11u

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 5, 2022
@openjdk openjdk bot closed this Dec 5, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 5, 2022
@openjdk
Copy link

openjdk bot commented Dec 5, 2022

@jmtd Pushed as commit c9007cd.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
3 participants