RFR: 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist [v2]

Bob Vandette bobv at openjdk.java.net
Thu Sep 24 19:20:04 UTC 2020


On Thu, 24 Sep 2020 17:20:28 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
>
> I'm not sure this extra gymnastics will be worth the added complexity. This makes the code somewhat harder to follow
> and, essentially, we end up checking whether or not the cgroup controller is being mounted under `/sys/fs/cgroup`. The
> code tracks any interesting controller, like `memory`, `cpu`, `cpuset` and `cpuacct` and records the mount point. It's
> going to be `/sys/fs/cgroup` for almost all cases, would it not?  The skip for non-/sys/fs/cgroup controllers ends up
> being either `/fo/bar/baz` or whatever the lead-up path to the first seen "interesting" controller is or
> `/sys/fs/cgroup`. I'm not convinced it's really anything other than `/sys/fs/cgroup`. How about a simpler solution like
> this?  https://github.com/jerboaa/jdk/commit/1323315036c0b7625cd1a05690b5944df8457bad  This seems to work for me.

I was expecting to see some logic in this "else if" section that recorded the first occurance but did the validation on
the second pass (cg_infos[CPUSET_IDX]._mount_path != NULL).  When this situation is detected, we accept the mount with
the /sys/fs/cgroup.

        } else if (strcmp(token, "cpuset") == 0) {
          assert(cg_infos[CPUSET_IDX]._mount_path == NULL, "stomping of _mount_path");
          cg_infos[CPUSET_IDX]._mount_path = os::strdup(tmpmount);
          cg_infos[CPUSET_IDX]._root_mount_path = os::strdup(tmproot);
          cg_infos[CPUSET_IDX]._data_complete = true;

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

PR: https://git.openjdk.java.net/jdk/pull/295


More information about the hotspot-runtime-dev mailing list