Unfortunately there has been no consensus on the cgroup-v2-cpu controller and it hasn't been merged to mainline. It allows limiting CPU ressources via cgroups. While it is not in mainline systemd provides functionality that relies on the cgroup-v2-cpu. The background is described in https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu Quoting the summary for easy reference: > All objections from the scheduler maintainers apply to cgroup v2 core > design, and there are no known objections to the specifics of the CPU > controller cgroup v2 interface. The only blocked part is changes to > expose the CPU controller interface on cgroup v2, which comprises the > following two patches: > > [1] sched: Misc preps for cgroup unified hierarchy interface > [2] sched: Implement interface for cgroup unified hierarchy > > The necessary changes are superficial and implement the interface > files on cgroup v2. The combined diffstat is as follows. > > kernel/sched/core.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++-- > kernel/sched/cpuacct.c | 57 ++++++++++++------ > kernel/sched/cpuacct.h | 5 + > 3 files changed, 189 insertions(+), 22 deletions(-) > > The patches are easy to apply and forward-port. The following git > branch will always carry the two patches on top of the latest release > of the upstream kernel. > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/cgroup-v2-cpu > > There also are versioned branches going back to v4.4. > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/cgroup-v2-cpu-$KERNEL_VER > > While it's difficult to tell whether the CPU controller support will > be merged, there are crucial resource control features in cgroup v2 > that are only possible due to the design choices that are being > objected to, and every effort will be made to ease enabling the CPU > controller cgroup v2 support out-of-tree for parties which choose to. Applying these patches would for example allow to limit CPU usage of emerge easily using systemd-run. > sudo systemd-run -p CPUWeight=X emerge --ask --newuse --update --deep @world And finally, judging from the paragraph below there seem to be no downsides with enabling these patches: > Finally, it's important to note that enabling cgroup v2 support for > the CPU controller doesn't block use cases which require the features > which are not available on cgroup v2. Unlikely, but should anybody > actually rely on the CPU controller's symmetric handling of tasks and > cgroups, backward compatibility is and will be maintained by being > able to disconnect the controller from the cgroup v2 hierarchy and use > it standalone. This also holds for cpuset which is often used in > highly customized configurations which might be a poor fit for common > resource domains.
Is there a complete defined patchset somewhere?
Does > git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/cgroup-v2-cpu > > There also are versioned branches going back to v4.4. > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/cgroup-v2-cpu-$KERNEL_VER qualify as complete defined patchset? Or would you like to get a patch file? It should be straightforward to get via 'git format-patch', but I'm not sure if it is available online. Would it be an option to run some scripts to create it?
looks like a candidate for experimental
This was merged for 4.15 https://lwn.net/Articles/739341/ .