RFR: 8333446: Add tests for hierarchical container support [v9]

Zdenek Zambersky zzambers at openjdk.org
Mon Sep 9 17:33:10 UTC 2024


On Wed, 4 Sep 2024 17:46:00 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Please review this PR which adds test support for systemd slices so that bugs like [JDK-8217338](https://bugs.openjdk.org/browse/JDK-8217338) can be verified. The added test, `SystemdMemoryAwarenessTest` currently passes on cgroups v1 and fails on cgroups v2 due to the way how [JDK-8217338](https://bugs.openjdk.org/browse/JDK-8217338) was implemented when JDK 13 was a thing. Therefore immediately problem-listed. It should get unlisted once [JDK-8322420](https://bugs.openjdk.org/browse/JDK-8322420) merges.
>> 
>> I'm adding those tests in order to not regress another time.
>> 
>> Testing:
>> - [x] Container tests on Linux x86_64 cgroups v2 and Linux x86_64 cgroups v1.
>> - [x] New systemd test on cg v1 (passes). Fails on cg v2 (due to  JDK-8322420)
>> - [x] GHA
>
> 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 17 additional commits since the last revision:
> 
>  - Adapt JDK-8339148
>  - Merge branch 'master' into jdk-8333446-systemd-slice-tests
>  - Merge branch 'master' into jdk-8333446-systemd-slice-tests
>  - Fix comment of WB::host_cpus()
>  - Handle non-root + CGv2
>  - Add nested hierarchy to test framework
>  - Revert "Add root check for SystemdMemoryAwarenessTest.java"
>    
>    This reverts commit 7e8d9ed46815096ae8c4502f3320ebf5208438d5.
>  - Add root check for SystemdMemoryAwarenessTest.java
>  - Merge branch 'master' into jdk-8333446-systemd-slice-tests
>  - Merge branch 'master' into jdk-8333446-systemd-slice-tests
>  - ... and 7 more: https://git.openjdk.org/jdk/compare/3d582133...30f32d22

I have done some testing on RHELs (build with changes from this PR + other 2 container PRs applied):
**RHEL-8** (cgroup1/non-root)
- test was skipped correctly

**RHEL-9** (cgroup2/non-root)
- I saw failure of `active_processor_count` check.
- after investigation, I have found, that `cpu` cgroup controller is not delegated to `user at 1000.service` (and children) on rhel-9 (unlike in e.g. fedora) it only had `memory pids` (btw. available controllers at given "level" are listed in `cgroup.controllers` file in cgroups v2)
- when I modified `user at .service` to also delegate cpu controller, test passed

Apart from issue with check for `active_processor_count` on RHEL-9/non-root, it looks good. However I don't know how to easily fix issue with `active_processor_count` check. Maybe check could be skipped for non-root. (Work-around is to modify system configuration.)

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

PR Comment: https://git.openjdk.org/jdk/pull/19530#issuecomment-2338674577


More information about the core-libs-dev mailing list