1 From 10e9081e9311264f34259527c8d08a8c95beb2da 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 128/196] config: Enable CONFIG_MEMCG, but leave it disabled
5 (due to memory cost). Enable with cgroup_enable=memory.
8 arch/arm/configs/bcmrpi_defconfig | 1 +
9 kernel/cgroup.c | 31 +++++++++++++++++++++++++++++++
11 3 files changed, 33 insertions(+)
13 diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig
14 index 31010e4..fd3229a 100644
15 --- a/arch/arm/configs/bcmrpi_defconfig
16 +++ b/arch/arm/configs/bcmrpi_defconfig
17 @@ -18,6 +18,7 @@ CONFIG_CGROUP_FREEZER=y
18 CONFIG_CGROUP_DEVICE=y
19 CONFIG_CGROUP_CPUACCT=y
20 CONFIG_RESOURCE_COUNTERS=y
24 CONFIG_SCHED_AUTOGROUP=y
25 diff --git a/kernel/cgroup.c b/kernel/cgroup.c
26 index d0def7f..de9d91a 100644
29 @@ -5127,6 +5127,37 @@ static int __init cgroup_disable(char *str)
31 __setup("cgroup_disable=", cgroup_disable);
33 +static int __init cgroup_enable(char *str)
38 + while ((token = strsep(&str, ",")) != NULL) {
41 + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
42 + struct cgroup_subsys *ss = subsys[i];
45 + * cgroup_enable, being at boot time, can't
46 + * know about module subsystems, so we don't
49 + if (!ss || ss->module)
52 + if (!strcmp(token, ss->name)) {
54 + printk(KERN_INFO "Enabling %s control group"
55 + " subsystem\n", ss->name);
62 +__setup("cgroup_enable=", cgroup_enable);
65 * Functons for CSS ID.
67 diff --git a/mm/memcontrol.c b/mm/memcontrol.c
68 index f45e21a..28a7e40 100644
71 @@ -6970,6 +6970,7 @@ struct cgroup_subsys mem_cgroup_subsys = {
72 .base_cftypes = mem_cgroup_files,
78 #ifdef CONFIG_MEMCG_SWAP