RFR: 8296125: Add a command line option to set a refresh rate of the OS cached metrics in Linux [v2]

Olga Mikhaltsova omikhaltcova at openjdk.org
Wed Nov 2 17:31:31 UTC 2022


On Wed, 2 Nov 2022 05:30:47 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Olga Mikhaltsova has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Made the option (OsCachedMetricsRefreshRate) DIAGNOSTIC
>>  - Moved oscontainer_cache_timeout() from os::Linux to OSContainer
>
> src/hotspot/os/linux/osContainer_linux.cpp line 68:
> 
>> 66:   return NANOSECS_PER_SEC / OsCachedMetricsRefreshRate;
>> 67: }
>> 68: 
> 
> I don't think the wrapper is needed, I'd just use the switch directly.

I prefer to keep this wrapper instead of using in the code "NANOSECS_PER_SEC / OsCachedMetricsRefreshRate" in order to preserve an easy reading of code and to be closer to the origin name of the replaced macro - OSCONTAINER_CACHE_TIMEOUT.

I decided to use a refresh rate instead of a timeout as a command line option for easier perception/setting of values i.e.: 50 times/s instead of 20000000 ns (= 20 ms)

But if to use a timeout in ns as a command line option then such a wrapper is not needed.

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

PR: https://git.openjdk.org/jdk/pull/10918


More information about the hotspot-runtime-dev mailing list