8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 whatcontainerMetrics.getCpuSetCpus()
returns. This is not needed in 11u since it doesn't have JDK-8231111 (adds cgroups v2 support) which changescontainerMetrics.getCpuSetCpus()
to potentially return null for "not supported". That's not applicable in 11.Thoughts?
Progress
Issue
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