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

8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available #9

Closed
wants to merge 1 commit into from

Conversation

jerboaa
Copy link
Contributor

@jerboaa jerboaa commented Jun 2, 2021

Please review this backport for OpenJDK 11u. For one it fixes a bug where wrong cpuload is being reported when there are not all CPUs on the host online, and for two is a preparatory backport for JDK-8265836.

The patch doesn't apply cleanly. The only difference is in context of the if condition in isCpuSetSameAsHostCpuSet(). In JDK 17 there is an additional null check for what containerMetrics.getCpuSetCpus() returns. This is not needed in 11u since it doesn't have JDK-8231111 (adds cgroups v2 support) which changes containerMetrics.getCpuSetCpus() to potentially return null for "not supported". That's not applicable in 11.

Thoughts?


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk11u-dev pull/9/head:pull/9
$ git checkout pull/9

Update a local copy of the PR:
$ git checkout pull/9
$ git pull https://git.openjdk.java.net/jdk11u-dev pull/9/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk11u-dev/pull/9.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 2, 2021

👋 Welcome back sgehwolf! 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 3341d361316def749c155242e6bf7fcbcb968531 8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available Jun 2, 2021
@openjdk
Copy link

openjdk bot commented Jun 2, 2021

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

@openjdk
Copy link

openjdk bot commented Jun 2, 2021

@jerboaa This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 2, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 2, 2021

Webrevs

@jerboaa
Copy link
Contributor Author

jerboaa commented Jun 8, 2021

/integrate

@openjdk openjdk bot closed this Jun 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 8, 2021
@openjdk
Copy link

openjdk bot commented Jun 8, 2021

@jerboaa Since your change was applied there have been 9 commits pushed to the master branch:

  • 6deb21f: 8196092: javax/swing/JComboBox/8032878/bug8032878.java fails
  • d3a5ed2: 8267773: PhaseStringOpts::int_stringSize doesn't handle min_jint correctly
  • f55ef1e: 8210495: compiler crashes because of illegal signature in otherwise legal code
  • e6d0e9d: 8266642: Improve ResolvedMethodTable hash function
  • 5c35022: 8211296: Remove HotSpot deprecation warning suppression for Mac/clang
  • 006979a: 8257148: Remove obsolete code in AWTView.m
  • be0b9b1: 8266615: C2 incorrectly folds subtype checks involving an interface array
  • ab9d3de: 8261652: Remove some dead comments from os_bsd_x86
  • 09d3082: 8265231: (fc) ReadDirect and WriteDirect tests fail after fix for JDK-8264821

Your commit was automatically rebased without conflicts.

Pushed as commit 624e91b.

💡 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 clean integrated Pull request has been integrated
2 participants