On Fri, 22 Nov 2024 09:54:39 GMT, Sergey Chernyshev <schernys...@openjdk.org> wrote:
> Here, `limit` at line 64 is not stored as a possible lowest limit, so if the > inner group has lower limit than the outer group, it won't be detected (cg v2 > is affected too). Good spot! How about this to fix it? jlong limit = mem->read_memory_limit_in_bytes(phys_mem); jlong lowest_limit = limit < 0 ? phys_mem: limit; > The cgroup path will be adjusted to the outer group (when it's limited). > Another issue is in the loop at line 66 that reduces the path. In cg v1 in > `cgroupns=host` mode (default) the cgroup_path includes the base cgroup and > the subgroup (when moved). It may be not quite obvious which part of the path > is the actual subgroup (and the CloudFoundry case has demonstrated it). It is > suggested to determine the actual subgroup (path suffix) before reducing the > group path. Please see the updated patch. I'm worried about the added complexity. 1.) Is this something that's needed in cg v2 too? If no, we are changing cg version agnostic code for a version specific issue. 2.) Wouldn't setting the cgroup path to `<mount_point>/<cgroup_path>` achieve the same thing, when it's currently `null` (in current master)? After all, those are corner cases which don't seem very common. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21808#discussion_r1853729062