summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-16 10:17:46 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:58:59 +0200
commited5faeef2ccf4bc8343ec96c6115add96ded195c (patch)
tree6961612c600595841b15e066991c309775df5213 /src/core
parent39154d61478a7440b1527f02afeff5b6ffb541ce (diff)
pid1: do not initialize join_controllers by default
We're moving towards unified cgroup hierarchy where this is not necessary. This makes main.c a bit simpler.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mount-setup.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index b35b90c36..cad593471 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -268,6 +268,19 @@ int mount_cgroup_controllers(char ***join_controllers) {
/* Mount all available cgroup controllers that are built into the kernel. */
+ if (!join_controllers)
+ /* The defaults:
+ * mount "cpu" + "cpuacct" together, and "net_cls" + "net_prio".
+ *
+ * We'd like to add "cpuset" to the mix, but "cpuset" doesn't really
+ * work for groups with no initialized attributes.
+ */
+ join_controllers = (char**[]) {
+ STRV_MAKE("cpu", "cpuacct"),
+ STRV_MAKE("net_cls", "net_prio"),
+ NULL,
+ };
+
r = cg_kernel_controllers(&controllers);
if (r < 0)
return log_error_errno(r, "Failed to enumerate cgroup controllers: %m");
@@ -286,10 +299,9 @@ int mount_cgroup_controllers(char ***join_controllers) {
if (!controller)
break;
- if (join_controllers)
- for (k = join_controllers; *k; k++)
- if (strv_find(*k, controller))
- break;
+ for (k = join_controllers; *k; k++)
+ if (strv_find(*k, controller))
+ break;
if (k && *k) {
char **i, **j;