RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v2]
Severin Gehwolf
sgehwolf at openjdk.org
Tue Aug 27 18:37:04 UTC 2024
On Tue, 27 Aug 2024 14:09:08 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Severin Gehwolf has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>>
>> - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init
>> - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init
>> - Remove some duplication
>> - Fix style
>> - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init
>> - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init
>> - Merge branch 'master' into jdk-8322420_cgroup_hierarchy_walk_init
>> - 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected
>
> src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 41:
>
>> 39: * on the contents of the mountinfo and cgroup files.
>> 40: */
>> 41: void CgroupV1Controller::set_subsystem_path(char *cgroup_path) {
>
> make argument const char*
Done.
> src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 42:
>
>> 40: */
>> 41: void CgroupV1Controller::set_subsystem_path(char *cgroup_path) {
>> 42: if (_cgroup_path != nullptr) {
>
> Strictly speaking the is-not-null condition is not necessary when you free stuff. nullptr are ignored on free.
Yes. I'm aware, but wanted to be explicit here as it more clearly shows the intent. Hope that's ok.
> src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 46:
>
>> 44: }
>> 45: if (_path != nullptr) {
>> 46: os::free(_path);
>
> Please set _path to nullptr, the dangling pointer makes me nervous.
It's set in the [initialization list](https://github.com/openjdk/jdk/pull/20646/files#diff-ca999d88f840ec06af060a8245bec6e0783fe60d7fe07908547111c10873c1f6R49) to `nullptr`. Is that not enough?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20646#discussion_r1733343879
PR Review Comment: https://git.openjdk.org/jdk/pull/20646#discussion_r1733346776
PR Review Comment: https://git.openjdk.org/jdk/pull/20646#discussion_r1733345378
More information about the hotspot-runtime-dev
mailing list