RFR: 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist [v2]
Volker Simonis
simonis at openjdk.java.net
Fri Sep 25 07:49:24 UTC 2020
On Thu, 24 Sep 2020 15:56:17 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Volker Simonis has refreshed the contents of this pull request, and previous commits have been removed. The incremental
>> views will show differences compared to the previous content of the PR. The pull request contains one new commit since
>> the last revision:
>> 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist
>
> src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 335:
>
>> 333: cg_infos[CPUSET_IDX]._mount_path = os::strdup(tmpmount);
>> 334: cg_infos[CPUSET_IDX]._root_mount_path = os::strdup(tmproot);
>> 335: cg_infos[CPUSET_IDX]._data_complete = true;
>
> It's not clear to me why `check_mount_path(&mount_path, tmpmount);` isn't called on this code path. Could you explain?
Because `cpusets` might be mounted to `/cpusets` or `/dev/cpusets` and we don't know if this manual mount point comes
before or after any of the others which belong to a Cgroup. If the manual mount point comes first in `mountinfo`,
`check_mount_path()` would record its mount path as the *correct* one and would bail out later, when checking the other
controllers.
The solution you propose in
[jerboaa at 1323315](https://github.com/jerboaa/jdk/commit/1323315036c0b7625cd1a05690b5944df8457bad) is of course simpler,
but it assumes that the Cgroup controllers are always mounted under `/sys/fs/cgroup`. I'm not sure about that and I
just wanted to avoid the next issue when popping up when the controllers are mounted to a different location. But if
you say they are always mounted under `/sys/fs/cgroup` I'm happy to use the simpler solution.
-------------
PR: https://git.openjdk.java.net/jdk/pull/295
More information about the hotspot-runtime-dev
mailing list