lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Aug 2014 19:27:32 +0800
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	<tj@...nel.org>, <lizefan@...wei.com>
CC:	<cgroups@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH] cgroup: Enable controllers for default hierarchy by default.

When we create a cgroup in unified hierarchy, we have to enable
controllers in cgrp_dfl_root.subtree_control manually. From
my practice, I did not find the benefit we disable controllers
in cgrp_dfl_root by default.

As I am a newbie to cgroup, please correct me if I am wrong.

Thanx.

Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
---
 kernel/cgroup.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7dc8788..70996ee 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1267,12 +1267,9 @@ static int rebind_subsystems(struct cgroup_root *dst_root, unsigned int ss_mask)
 		src_root->cgrp.subtree_control &= ~(1 << ssid);
 		cgroup_refresh_child_subsys_mask(&src_root->cgrp);
 
-		/* default hierarchy doesn't enable controllers by default */
 		dst_root->subsys_mask |= 1 << ssid;
-		if (dst_root != &cgrp_dfl_root) {
-			dst_root->cgrp.subtree_control |= 1 << ssid;
-			cgroup_refresh_child_subsys_mask(&dst_root->cgrp);
-		}
+		dst_root->cgrp.subtree_control |= 1 << ssid;
+		cgroup_refresh_child_subsys_mask(&dst_root->cgrp);
 
 		if (ss->bind)
 			ss->bind(css);
@@ -4990,6 +4987,8 @@ int __init cgroup_init(void)
 		}
 	}
 
+	cgrp_dfl_root.cgrp.subtree_control = cgrp_dfl_root.subsys_mask;
+
 	cgroup_kobj = kobject_create_and_add("cgroup", fs_kobj);
 	if (!cgroup_kobj)
 		return -ENOMEM;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ