RFR: 8268098: jdk.CPULoad event reports incorrect CPU usage inside a container

Severin Gehwolf sgehwolf at openjdk.java.net
Mon Jun 7 10:00:58 UTC 2021


On Thu, 3 Jun 2021 02:40:16 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Hi Yasumasa,
> 
> I'm a bit confused. We seem to have this logic in two places - one in the VM and one in the JDK libraries. Shouldn't this fix look like the fix for JDK-8265836? Can we have just one chunk of code that handles all this?

FWIW, this duplication is pre-existing. One `cpuLoad()` implementation is in the JMX mbean native code:
https://github.com/openjdk/jdk/blob/5ebd4199cc57b60ab7345a019d000c0017a90fc3/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c#L246
another in os_perf_linux.cpp in HotSpot:
https://github.com/openjdk/jdk/blob/5ebd4199cc57b60ab7345a019d000c0017a90fc3/src/hotspot/os/linux/os_perf_linux.cpp#L338

This patch doesn't change that. But yes, I agree, there are too many areas in HotSpot and JDK library code where duplicated or similar code is present.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4299


More information about the hotspot-runtime-dev mailing list