On Fri, 29 Nov 2024 14:47:13 GMT, Sergey Chernyshev <schernys...@openjdk.org> wrote:
> > Right. I'm still not convinced this extra reduction buys us much. The > > adjust controller logic will handle it if kept as is in the Metrics version. > > The adjust controller logic won't handle it, because it reduces the path from > child to parent. It's goal is to locate the smallest limit. It's goal is to find the path for a specific controller that has the lowest limit and keeps that path for that controller for the rest of the run-time of the JVM. Consider a case where this reduction currently happens in `set_subsystem_path()`. Instead of the manual work of setting it to a path where the directory actually exists we set it to `<mount_path>/<cgroup_path>`. In the cloudflare case we'd end up with a subsystem path of `/sys/fs/cgroup/cpu,cpuacct/system.slice/garden.service/garden/bad/2f57368b-0eda-4e52-64d8-af5c`. Since the cgroup_path != _root we trigger path adjustment increasing the chance to detect any lower limit in any of the paths down to the mount point. By doing so **and** there is a lower limit in the hierarchy we know the path exists as well and that is being used from then on. So if `/sys/fs/cgroup/cpu,cpuacct/system.slice/garden.service/garden` existed and has a limit it would be used. I thought this is the reason why cg v2 didn't need the same fix when `--cgroupns=host` is used. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21808#discussion_r1863797758