RFR: 8302744: Refactor Hotspot container detection code [v3]
Johan Sjölen
jsjolen at openjdk.org
Mon May 27 12:54:05 UTC 2024
On Mon, 27 May 2024 12:50:16 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 16 additional commits since the last revision:
>>
>> - Add proper comments for parsing utility functions
>> - Add a test for a large string read
>> - Add convenience function for 'max' handling
>>
>> This now makes limit_from_str a private method
>> - Fix general read string cases.
>> - Get rid of the templated function
>> - Use enum class for TupleValue
>> - Merge branch 'master' into jdk-8302744-cleanup-getcontainer-info
>> - Fix TestMemoryAwareness for cgroup v2
>>
>> It only reads the swap value, thus doesn't print:
>> "Memory and Swap Limit is" but rather prints:
>> "Swap Limit is". This is fine, since for cg v2
>> the memory limit and the swap limits are in different
>> files.
>> - Fix whitespace
>> - Handle cpu quota for cgroups v1 specially
>> - ... and 6 more: https://git.openjdk.org/jdk/compare/60138569...c41d3183
>
> src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp line 152:
>
>> 150: bool is_ok = _memory->controller()->
>> 151: read_numerical_key_value("/memory.stat", "anon", &rss);
>> 152: if (!is_ok) {
>
> Style, nit: A bit unconventional (for Hotspot) to line break after `->`, maybe this is preferable:
>
> ```c++
> bool is_ok =
> _memory->controller()->read_numerical_key_value("/memory.stat", "anon", &rss);
Or each argument can be line-separated, just a couple of ideas.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19060#discussion_r1616012371
More information about the hotspot-runtime-dev
mailing list