On Sat, 23 Nov 2024 10:28:42 GMT, Sergey Chernyshev <schernys...@openjdk.org> 
wrote:

>>> The added code in `CgroupUtil::adjust_controller` runs for cg v1 and cg v2 
>>> when path adjustment is deemed needed. So I'm not clear why it's needed for 
>>> cg v2
>> 
>> It looks like there's no way to see at this point, if we are in cgroup v1 or 
>> v2 - if I am not mistaken.
>> 
>>> I thought we have established that for cg v2 && `--cgroupns=host` the 
>>> current path adjustment is sufficient? What am I missing?
>> 
>> The current path adjustment still needs correction of `lowest_limit` in cg 
>> v2. Also allocating `limit_cg_path` is important, that's why I added the if 
>> block.
>
>> It looks like there's no way to see at this point, if we are in cgroup v1 or 
>> v2 - if I am not mistaken.
> 
> On the other hand, a type parameter can be added to 
> `CgroupUtil::adjust_controller()`. Would you recommend doing so?

@sercher I wouldn't recommend adding a type parameter. 
`CgroupUtil::adjust_controller` should stay cgroup version agnostic. Version 
specific code can be had in `set_subsystem_path()` of the corresponding impl 
(like an earlier version of your patch). `lowest_limit` and `limit_cg_path` 
fixes are version agnostic and can and should be fixed in 
`CgroupUtil::adjust_controller`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21808#discussion_r1856241432

Reply via email to