RFR: 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist
Volker Simonis
simonis at openjdk.java.net
Tue Sep 22 11:18:57 UTC 2020
Hi,
can I please have a review (or an idea for a better fix) for this PR?
If a tool like [cpuset](https://github.com/lpechacek/cpuset) is used to manually create and manage
[cpusets](https://man7.org/linux/man-pages/man7/cpuset.7.html) the cgroups detections will be confused and crash in a
debug build or behave unexpectedly in a product build.
The problem is that the additionally mounted cpuset will be interpreted as if it was belonging to Cgroup controller:
$ grep cgroup /proc/self/mountinfo
36 25 0:30 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:9 - tmpfs tmpfs ro,mode=755
49 36 0:43 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:23 - cgroup cgroup rw,memory
50 36 0:44 / /sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime shared:24 - cgroup cgroup rw,rdma
...
43 36 0:37 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,cpuset
121 32 0:37 / /cpusets rw,relatime shared:69 - cgroup none rw,cpuset
The current fix solves this problem for manually created cpusets which don't have a "mount source" but this is yet
another heuristic. I'm open to better solutions for detecting cpusets which don't don't belong to a Cgroup.
Thanks,
Volker
-------------
Commit messages:
- 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist
Changes: https://git.openjdk.java.net/jdk/pull/295/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=295&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8253435
Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/295.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/295/head:pull/295
PR: https://git.openjdk.java.net/jdk/pull/295
More information about the hotspot-runtime-dev
mailing list