diff options
author | Chris Down <chris@chrisdown.name> | 2018-12-03 14:38:06 +0000 |
---|---|---|
committer | Chris Down <chris@chrisdown.name> | 2018-12-03 15:40:31 +0000 |
commit | c72703e26d21cb4994f21ae50c4e18675b02ded3 (patch) | |
tree | c2f6cf0b7772548594323b2c98aa6bea387b303e /src/core/load-fragment.h | |
parent | 4f6f62e468db358a25abf51668c881105b35dc24 (diff) | |
download | systemd-c72703e26d21cb4994f21ae50c4e18675b02ded3.tar.gz |
cgroup: Add DisableControllers= directive to disable controller in subtree
Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.
This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.
Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.
This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.
Diffstat (limited to 'src/core/load-fragment.h')
-rw-r--r-- | src/core/load-fragment.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h index 71d94a7762..e0d3b4ec3b 100644 --- a/src/core/load-fragment.h +++ b/src/core/load-fragment.h @@ -105,6 +105,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_log_extra_fields); CONFIG_PARSER_PROTOTYPE(config_parse_collect_mode); CONFIG_PARSER_PROTOTYPE(config_parse_pid_file); CONFIG_PARSER_PROTOTYPE(config_parse_exit_status); +CONFIG_PARSER_PROTOTYPE(config_parse_disable_controllers); /* gperf prototypes */ const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length); |