You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor cgroup to allow multiple properties per controller
The previous Cgroup implementation used a separate object per
every cgroup property. This lead to additional calls to
create_dir_all and writes to cgroup.procs, especially in
cgroupsv2 where there is only one hierarchy.
This change prevents the duplication by refactoring the code into:
- CgroupConfiguration: this holds multiple cgroup properties in
multiple cgroup controllers and hierarchies
- Cgroup: this holds the configuration for a hierarchy and holds
multiple properties
- CgroupProperty: a file to value mapping of the cgroup properties
to be written.
The CgroupBuilder is changed to a CgroupConfigurationBuilder so that
the setup of the Cgroup is abstracted away from the environment.
Additionally, in the CgroupV2 the available controllers read from
cgroup.controllers are cached to avoid multiple unnecessary reads.
Signed-off-by: Riccardo Mancini <[email protected]>
0 commit comments