[jdk11u-dev] RFR: 8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available
Severin Gehwolf
sgehwolf at openjdk.java.net
Wed Jun 2 17:20:51 UTC 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?
-------------
Commit messages:
- Backport 3341d361316def749c155242e6bf7fcbcb968531
Changes: https://git.openjdk.java.net/jdk11u-dev/pull/9/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk11u-dev&pr=9&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8247469
Stats: 36 lines in 4 files changed: 32 ins; 0 del; 4 mod
Patch: https://git.openjdk.java.net/jdk11u-dev/pull/9.diff
Fetch: git fetch https://git.openjdk.java.net/jdk11u-dev pull/9/head:pull/9
PR: https://git.openjdk.java.net/jdk11u-dev/pull/9
More information about the jdk-updates-dev
mailing list