[jdk8u-dev] RFR: 8230305: Cgroups v2: Container awareness [v2]
Jonathan Dowland
jdowland at openjdk.org
Mon Oct 31 11:32:44 UTC 2022
On Mon, 17 Oct 2022 16:25:31 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Jonathan Dowland has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>>
>> - substitute os::strerror for strerror
>>
>> os::strerror was introduced in 8148425 (strerror() function is not
>> thread-safe), which is probably out of scope for backporting (at least
>> as part of this cgroups v2 effort). Replace uses of os::strerror with
>> (thread unsafe) strerror, in common with the rest of JDK8u.
>> - Rework use of newer logging API to tty->print_cr
>>
>> Remove includes of log.hpp that doesn't exist in jdk8u
>>
>> log_(debug|trace) to tty->print_cr guarded by PrintContainerInfo
>> - 8230305: Cgroups v2: Container awareness
>>
>> Implement Cgroups v2 container awareness in hotspot
>>
>> Reviewed-by: bobv, dholmes
>
> hotspot/src/os/linux/vm/cgroupSubsystem_linux.cpp line 431:
>
>> 429: if (!memory_limit->should_check_metric()) {
>> 430: return memory_limit->value();
>> 431: }
>
> This is actually code added with [JDK-8232207](https://bugs.openjdk.org/browse/JDK-8232207) which shouldn't affect JDK 8. So I'm not sure about this. Add it to 8u anyway (and have less divergence) or remove and deal with the code difference.
>
> Whatever the way, we need to make this clear by: a) adding the issue using `/issue add` or b) restructuring this code to account for it. I'm slightly in favor of b).
I tried a very basic JMH bench with/without the memory caching in place and it had no obvious impact one way or another, but I'm leaning towards a) because removing it means re-working quite a few bits, including switching _memory from a CachingCgroupController to CgroupController (or CgroupV1Controller etc) so the macros GET_CONTAINER_INFO and friends still work. The deltas will be across at least four source files.
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/127
More information about the jdk8u-dev
mailing list