kernel: update kernel 4.4 to 4.4.69
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
1 From 64f24afea7e30d68004f0d8db7822f87859d8dac 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.
6
7 ---
8 kernel/cgroup.c | 23 ++++++++++++++++++++++-
9 1 file changed, 22 insertions(+), 1 deletion(-)
10
11 --- a/kernel/cgroup.c
12 +++ b/kernel/cgroup.c
13 @@ -5311,7 +5311,7 @@ int __init cgroup_init_early(void)
14 return 0;
15 }
16
17 -static unsigned long cgroup_disable_mask __initdata;
18 +static unsigned long cgroup_disable_mask __initdata = 1<<0;
19
20 /**
21 * cgroup_init - cgroup initialization
22 @@ -5807,6 +5807,27 @@ static int __init cgroup_disable(char *s
23 }
24 __setup("cgroup_disable=", cgroup_disable);
25
26 +static int __init cgroup_enable(char *str)
27 +{
28 + struct cgroup_subsys *ss;
29 + char *token;
30 + int i;
31 +
32 + while ((token = strsep(&str, ",")) != NULL) {
33 + if (!*token)
34 + continue;
35 +
36 + for_each_subsys(ss, i) {
37 + if (strcmp(token, ss->name) &&
38 + strcmp(token, ss->legacy_name))
39 + continue;
40 + cgroup_disable_mask &= ~(1 << i);
41 + }
42 + }
43 + return 1;
44 +}
45 +__setup("cgroup_enable=", cgroup_enable);
46 +
47 /**
48 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
49 * @dentry: directory dentry of interest