RFR: 8334254: Cleanup CGroups initialization code

Severin Gehwolf sgehwolf at openjdk.org
Fri Jun 14 13:46:23 UTC 2024


On Thu, 13 Jun 2024 18:20:33 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Hi,
> 
> Please consider this patch which attempts to improve the code quality of some of the cgroups code, somewhat.
> 
> 1. Get rid of `#define`s and upgrade to a `CG_INFO` enum, with some helpers
> 2. Make some of the code prettier by removing copy-pasted and edited code
> 3. Make `CgroupInfo` RAII, ridding us of the `cleanup` function
> 4. `set_subsystem_path` is **only** used at construction time, only call it at that time and make those functions private. Also remove `virtual`ness, as this is unnecessary now.
> 
> Testing:
> 
> 1. cgroupTest group in gtest.
> 
> Thank you.

src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp line 42:

> 40:     /* Constructed subsystem directory */
> 41:     char *_path;
> 42:     void set_subsystem_path(char *cgroup_path);

Come to think of it, `set_subsystem_path()` needs to remain public, since that's the hook for adjusting a controllers' path that we'd need.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19709#discussion_r1639852649


More information about the hotspot-runtime-dev mailing list