RFR: 8268098: jdk.CPULoad event reports incorrect CPU usage inside a container
David Holmes
david.holmes at oracle.com
Mon Jun 7 10:33:43 UTC 2021
On 7/06/2021 8:00 pm, Severin Gehwolf wrote:
> 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.
Leaving aside that consolidating to one copy of the code should be done
as a future RFE, shouldn't the existing two copies behave in exactly the
same way?
David
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/4299
>
More information about the hotspot-runtime-dev
mailing list