[jdk21u-dev] RFR: 8331560: Refactor Hotspot container detection code so that subsystem delegates to controllers [v3]

Severin Gehwolf sgehwolf at openjdk.org
Tue Jun 24 12:36:39 UTC 2025


On Tue, 24 Jun 2025 11:23:17 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> A patch 5 of 7 for: [[21u] Backport intention of 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected](https://mail.openjdk.org/pipermail/jdk-updates-dev/2025-April/043206.html)
>> 
>> It has a patch dependency on PR 3 of 7: https://github.com/openjdk/jdk21u-dev/pull/1661
>> 
>> This backport is not clean:
>> 
>>  - `src/hotspot/os/linux/cgroupSubsystem_linux.hpp`, `src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp`, `src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp`, `src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp`, `src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp` are missing `CgroupSubsystem::memory_and_swap_usage_in_bytes()` as [JDK-8325139](https://github.com/openjdk/jdk/commit/3d106cb091de6b6ef2a9bf483fb0f5c98c28263c) has not been backported.
>> 
>>  - `src/hotspot/os/linux/cgroupSubsystem_linux.hpp`, `src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp`, `src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp`, `src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp`, `src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp` are missing `CgroupSubsystem::rss_usage_in_bytes()` and `CgroupSubsystem::cache_usage_in_bytes()` as [JDK-8313083](https://github.com/openjdk/jdk/commit/c96cbe481c86800b76e220374b24b6671984adb7) has not been backported.
>> 
>> The whole patchset has been tested on CentOS-7.9 (for cgroup v1) and on Fedora 40 (for cgroup v2) for test/hotspot/jtreg/containers.
>
> Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
> 
>  - Merge remote-tracking branch 'janjdk21u-dev/devmaster-cgroup2reduced1234b' into devmaster-cgroup2reduced1234-conflict
>  - 8331560: Refactor Hotspot container detection code so that subsystem delegates to controllers
>    
>    Reviewed-by: jsjolen, stuefe
>  - 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container
>    
>    Reviewed-by: stuefe, iklam
>  - src/java.base/linux/native/libjava/CgroupMetrics.c:42:(.text+0x11): undefined reference to `JVM_IsContainerized'
>     - a patch by Yuri Nesterenko
>  - 8333326: Linux Alpine build fails after 8302744
>    
>    Reviewed-by: sgehwolf, clanger, stuefe
>  - 8302744: Refactor Hotspot container detection code
>    
>    Reviewed-by: jsjolen, stuefe
>  - rss/cache fixups.
>  - 8331560: Refactor Hotspot container detection code so that subsystem delegates to controllers
>    
>    Reviewed-by: jsjolen, stuefe

There are still some unrelated changes in the patch.

src/hotspot/share/opto/convertnode.cpp line 84:

> 82:         return nullptr;
> 83:       }
> 84: 

This looks like an unrelated change. Please remove.

test/jdk/jdk/internal/platform/cgroup/TestSystemSettings.java line 27:

> 25:  * @test
> 26:  * @key cgroups
> 27:  * @requires (os.family == "linux" & !vm.musl)

Same here. Unrelated. Perhaps not using up-to-date master branch?

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

Changes requested by sgehwolf (Reviewer).

PR Review: https://git.openjdk.org/jdk21u-dev/pull/1662#pullrequestreview-2953616486
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/1662#discussion_r2163862268
PR Review Comment: https://git.openjdk.org/jdk21u-dev/pull/1662#discussion_r2163867655


More information about the jdk-updates-dev mailing list