1 From c50fe09c78e9b87137e0188139c774bd4f12dcb2 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Wed, 18 Dec 2013 22:16:19 +0000
4 Subject: [PATCH] config: Enable CONFIG_MEMCG, but leave it disabled (due to
5 memory cost). Enable with cgroup_enable=memory.
8 kernel/cgroup.c | 24 +++++++++++++++++++++++-
9 1 file changed, 23 insertions(+), 1 deletion(-)
13 @@ -5636,7 +5636,7 @@ int __init cgroup_init_early(void)
17 -static u16 cgroup_disable_mask __initdata;
18 +static u16 cgroup_disable_mask __initdata = 1<<0;
21 * cgroup_init - cgroup initialization
22 @@ -6177,6 +6177,28 @@ static int __init cgroup_no_v1(char *str
24 __setup("cgroup_no_v1=", cgroup_no_v1);
26 +static int __init cgroup_enable(char *str)
28 + struct cgroup_subsys *ss;
32 + while ((token = strsep(&str, ",")) != NULL) {
36 + for_each_subsys(ss, i) {
37 + if (strcmp(token, ss->name) &&
38 + strcmp(token, ss->legacy_name))
41 + cgroup_disable_mask &= ~(1 << i);
46 +__setup("cgroup_enable=", cgroup_enable);
49 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
50 * @dentry: directory dentry of interest