RFR: 8349988: Change cgroup version detection logic to not depend on /proc/cgroups [v4]
Ashutosh Mehra
asmehra at openjdk.org
Tue Apr 1 07:06:16 UTC 2025
On Mon, 31 Mar 2025 21:26:37 GMT, Thomas Fitzsimmons <duke at openjdk.org> wrote:
>> test/hotspot/jtreg/containers/cgroup/CgroupSubsystemFactory.java line 459:
>>
>>> 457: public void testCgroupv1SystemdOnly(WhiteBox wb) {
>>> 458: String procCgroups = cgroupv1CgInfoZeroHierarchy.toString();
>>> 459: String procSelfCgroup = cgroupV2SelfCgroup.toString();
>>
>> I don't get why is this change required? The test name `testCgroupv1SystemdOnly` suggests it is testing cgroup v1 only but then it passes cgroup v2 proc file. Same for `testCgroupv1NoMounts`.
>
> Thank you for reviewing. This test consistency fix is discussed [here](https://github.com/openjdk/jdk/pull/23811#discussion_r1973877201) and [here](https://github.com/openjdk/jdk/pull/23811#discussion_r1978045429); I agree the result is confusing. Instead I will change `cgroupv1CgInfoZeroHierarchy` to `cgroupv1CgInfoNonZeroHierarchy` which achieves the same effect using only `cgroup v1` fields.
Yeah that would be better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23811#discussion_r2022267066
More information about the hotspot-dev
mailing list