On Mon, 22 Jul 2024 09:07:31 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:

>> Jan Kratochvil has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Unify 4 copies of adjust_controller()
>
> src/hotspot/os/linux/cgroupUtil_linux.cpp line 64:
> 
>> 62:     return cpu->adjust_controller(cpu_total);
>> 63:   }
>> 64:   return cpu;
> 
> I guess an alternative - and maybe more readable solution - would be to 
> inline `cpu->adjust_controller()` and `mem->adjust_controller()` code here. 
> We have cg version agnostic api to query the limits. We'd just need accessors 
> for `cgroup_path()` and a setter, `set_cgroup_path()` in 
> `CgroupCpuController/CgroupMemoryController` impls.

Currently (before my refactorization) the same code is duplicated 4 times. Do I 
understand the plan correctly it should be still duplicated but just 2 times? 
As without the duplication I do not see how to inline it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17198#discussion_r1694556054

Reply via email to