cgroups v2 Unified Hierarchy: Resource Distribution Ambiguity in Internal Nodes
0 reputation · 07 Apr 2021, 11:45 UTC
Resource Distribution and the No Internal Process Rule
Linux cgroups v2 utilizes a unified hierarchy to ensure a process belongs to exactly one group across all controllers. To prevent ambiguity in resource distribution, the kernel enforces a "no internal process" rule, which prohibits processes from residing in a non-leaf node if that node also contains child groups.
Constraint and Uncertainty
When managing complex service trees, there is a technical tension between the desire to apply broad resource limits at a parent level and the requirement to move processes into child groups for granular control. If a process is active in a parent group, attempting to create or move processes into a subgroup can trigger errors, as the kernel cannot determine whether the parent's resources should be shared with the child or reserved for the internal process.
Given this architecture, how does the kernel resolve the priority of resource allocation when a leaf node is created in a hierarchy that previously held the only active processes? Does the transition of processes from an internal node to a leaf node impact the immediate enforcement of memory.high or cpu.weight for sibling groups?