1 From 32839a570568823b3a1128bb1ae6c5fe3e9870af 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 024/114] 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 | 23 +++++++++++++++++++++++
11 3 files changed, 25 insertions(+)
13 diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig
14 index e2da9da..897616c 100644
15 --- a/arch/arm/configs/bcmrpi_defconfig
16 +++ b/arch/arm/configs/bcmrpi_defconfig
17 @@ -19,6 +19,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 136ecea..c909506 100644
29 @@ -5322,6 +5322,29 @@ static int __init cgroup_disable(char *str)
31 __setup("cgroup_disable=", cgroup_disable);
33 +static int __init cgroup_enable(char *str)
35 + struct cgroup_subsys *ss;
39 + while ((token = strsep(&str, ",")) != NULL) {
43 + for_each_subsys(ss, i) {
44 + if (!strcmp(token, ss->name)) {
46 + printk(KERN_INFO "Enabling %s control group"
47 + " subsystem\n", ss->name);
54 +__setup("cgroup_enable=", cgroup_enable);
56 static int __init cgroup_set_legacy_files_on_dfl(char *str)
58 printk("cgroup: using legacy files on the default hierarchy\n");
59 diff --git a/mm/memcontrol.c b/mm/memcontrol.c
60 index 4918b6e..168498c 100644
63 @@ -6207,6 +6207,7 @@ struct cgroup_subsys memory_cgrp_subsys = {
64 .bind = mem_cgroup_bind,
65 .legacy_cftypes = mem_cgroup_files,
70 #ifdef CONFIG_MEMCG_SWAP