RFR: 8349988: Change cgroup version detection logic to not depend on /proc/cgroups [v4]

Ashutosh Mehra asmehra at openjdk.org
Tue Apr 1 12:22:25 UTC 2025


On Thu, 6 Mar 2025 10:42:39 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Thomas Fitzsimmons 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 13 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into cgroups-v2-version-check-and-controllers-parsing-1
>>  - Replace literal tabs in procCgroupsCgroupsV1CpusetDisabledContent
>>  - Detect cpuset-disabled condition during cgroups v1 /proc/cgroups parsing
>>    
>>    Remove from cgroups v1 branch incorrect log messages about cpuset
>>    controller being optional.  Add test case for cgroups v1, cpuset
>>    disabled.
>>  - Improve !cgroups_v2_enabled branch comment
>>  - Debug-log optional and disabled cgroups v2 controllers
>>    
>>    Do not log enabled controllers that are not relevant to the JDK.
>>  - Move index declaration to scope in which it is used
>>  - Remove empty string check during cgroup.controllers parsing
>>  - Define ISSPACE_CHARS macro, use it in strsep call
>>  - Pass fgets result to strsep
>>  - Replace is_cgroupsV2 with cgroups_v2_enabled
>>    
>>    Also fix the testCgroupv1SystemdOnly and testCgroupv1NoMounts test
>>    cases such that their /proc/cgroups and /proc/self/cgroup contents
>>    correspond.  This prevents assertion failures these tests were
>>    producing when is_cgroupsV2 was replaced with cgroups_v2_enabled.
>>  - ... and 3 more: https://git.openjdk.org/jdk/compare/fa4cded7...b6926e15
>
> @tstuefe @ashu-mehra Could you please help with a second review?

@jerboaa @fitzsim Does the current mainline code handles mixed configuration where in some controllers are v1 and others v2? For example cpu controller is mounted as v1 while memory controller as v2.
 If yes, does this patch continue to support such configuration?

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

PR Comment: https://git.openjdk.org/jdk/pull/23811#issuecomment-2769176066


More information about the hotspot-dev mailing list