[8u] RFR: 8265836: OperatingSystemImpl.getCpuLoad() returns incorrect CPU load inside a container

Andrew Hughes gnu.andrew at redhat.com
Tue Aug 3 03:45:43 UTC 2021


On 19:05 Tue 13 Jul     , Severin Gehwolf wrote:
> Hi,
> 
> Please review this fix for cpu load reporting via the
> OperatingSystemMXBean inside containers. With JDK-8226575[1] that mbean
> has been made container aware and should therefore also report cpu load
> according to the container settings. It currently reports incorrect
> values. The backport depends on a backport of JDK-8247469, which has
> been proposed here (already reviewed by Andrew Dinn):
> 
> https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-July/014106.html
> 
> The OpenJDK 11u patch doesn't apply cleanly since there have been
> various refactorings in this area in later JDKs. The meat of the patch
> is largely the same, though.
> 
> In particular changes to UnixOperatingSystem.c in JDK 11 have been done
> in LinuxOperatingSystem.c in 8u, the package name in 8u is
> sun.management over com.sun.management.internal (in 11u). Finally, the
> new native method needs an entry in mapfile-vers.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8265836
> webrev: https://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8265836/jdk8/01/webrev/
> 
> Testing: Builds on Linux x86_64, Solaris Sparc, AIX. Tier 1 tests, no
>          new regressions. Manual testing with the reproducer of the
>          bug.
> 
> Thoughts?
> 
> Thanks,
> Severin
> 
> [1] https://bugs.openjdk.java.net/browse/JDK-8226575
> 

Looks fine and pretty close to 11u once the patch is reordered so the files
occur in the same order.  Approved.
-- 
Andrew :)
Pronouns: he / him or they / them
Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list