RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v15]

Jan Kratochvil jkratochvil at openjdk.org
Tue Jul 30 07:47:55 UTC 2024


On Mon, 29 Jul 2024 05:03:22 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> 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.

I have committed something, not sure if it is what was intended.

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

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


More information about the core-libs-dev mailing list