[jdk11u-dev] Integrated: 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
Tue Jun 8 08:17:24 UTC 2021
On Wed, 2 Jun 2021 17:14:12 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> 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?
This pull request has now been integrated.
Changeset: 624e91bd
Author: Severin Gehwolf <sgehwolf at openjdk.org>
URL: https://git.openjdk.java.net/jdk11u-dev/commit/624e91bd097a8f66c08e526954e89f06a0617a24
Stats: 36 lines in 4 files changed: 32 ins; 0 del; 4 mod
8247469: getSystemCpuLoad() returns -1 on linux when some offline cpus are present and cpusets.effective_cpus is not available
Backport-of: 3341d361316def749c155242e6bf7fcbcb968531
-------------
PR: https://git.openjdk.java.net/jdk11u-dev/pull/9
More information about the jdk-updates-dev
mailing list