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

Severin Gehwolf sgehwolf at openjdk.org
Fri Aug 30 14:23:20 UTC 2024


On Fri, 30 Aug 2024 14:14:05 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 incrementally with four additional commits since the last revision:
> 
>  - 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.

I've updated the patch to:

1. Run tests on cg v2 when non-root (uses `~/.config/systemd/user`) directory and `systemctl --user` as well as `systemd-run --user` in that case.
2. The framework now also sets it up so that there is a lower limit further down the hierarchy: `jdk_internal.slice.d` directory has the lowest limit. The slice files itself have a higher one. The test asserts that the lower limit is being detected correctly.
3. The framework now skips the test in the main entry point (i.e. on cg v1 and non-root).
4. Addressed review comments so far.

Tested on cg v1 and cg v2 as root and non-root each (with the patch of #20646 applied as well).

Please let me know what you think.

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

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


More information about the core-libs-dev mailing list