]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/load-fragment.c
core: add cgroup CPU controller support on the unified hierarchy 3905/head
authorTejun Heo <htejun@fb.com>
Sun, 7 Aug 2016 13:45:39 +0000 (09:45 -0400)
committerTejun Heo <tj@kernel.org>
Sun, 7 Aug 2016 13:45:39 +0000 (09:45 -0400)
commit66ebf6c0a1005f90099e25ece5630551ad97a3c3
treed66af9b366845249937bf6b16025552e97ff25be
parentceab9e2deee29dfda213a30c533c7dcd59c6bcad
core: add cgroup CPU controller support on the unified hierarchy

Unfortunately, due to the disagreements in the kernel development community,
CPU controller cgroup v2 support has not been merged and enabling it requires
applying two small out-of-tree kernel patches.  The situation is explained in
the following documentation.

 https://git.kernel.org/cgit/linux/kernel/git/tj/cgroup.git/tree/Documentation/cgroup-v2-cpu.txt?h=cgroup-v2-cpu

While it isn't clear what will happen with CPU controller cgroup v2 support,
there are critical features which are possible only on cgroup v2 such as
buffered write control making cgroup v2 essential for a lot of workloads.  This
commit implements systemd CPU controller support on the unified hierarchy so
that users who choose to deploy CPU controller cgroup v2 support can easily
take advantage of it.

On the unified hierarchy, "cpu.weight" knob replaces "cpu.shares" and "cpu.max"
replaces "cpu.cfs_period_us" and "cpu.cfs_quota_us".  [Startup]CPUWeight config
options are added with the usual compat translation.  CPU quota settings remain
unchanged and apply to both legacy and unified hierarchies.

v2: - Error in man page corrected.
    - CPU config application in cgroup_context_apply() refactored.
    - CPU accounting now works on unified hierarchy.
13 files changed:
man/systemd.resource-control.xml
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/cgtop/cgtop.c
src/core/cgroup.c
src/core/cgroup.h
src/core/dbus-cgroup.c
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/load-fragment.h
src/core/unit.c
src/core/unit.h
src/shared/bus-unit-util.c