RFR: 8268098: jdk.CPULoad event reports incorrect CPU usage inside a container
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Tue Jun 8 08:26:20 UTC 2021
On Tue, 8 Jun 2021 08:03:42 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Further investigation, I think need to read cpuacct.usage in cgroups v1, or cpu.stat in cgroups v2 when `get_cpu_load()` is called with `CPU_LOAD_GLOBAL` - @jerboaa did you point it out?
>>
>> Of course I can add it to this PR, but if we work for it, I think we should consolidate implementation - but it may not happen until RDP 1 (and it might be big change).
>>
>> Hence I will withdraw this PR and will close JBS, is it ok?
>
> @YaSuenag Yes, that's what `Metrics.getCpuUsage()` does under the hood. I'd suggest to first add the `get_cpu_usage()` API to `OSContainer` and then once it's there use it here. Or maybe consolidate things and you'll get away with using the Java API. Either way I'm fine with waiting/withdrawing.
Thanks @jerboaa !
I will withdraw this PR and will close JBS. I hope we will consolidate logics in near future...
-------------
PR: https://git.openjdk.java.net/jdk/pull/4299
More information about the hotspot-runtime-dev
mailing list