brcm2708: update linux 4.4 patches to latest version
[openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0062-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
1 From d0f48fe7aab3e4036fd55b491a9be94ea24f377d 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 062/170] config: Enable CONFIG_MEMCG, but leave it disabled
5  (due to 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 @@ -5286,7 +5286,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 @@ -5782,6 +5782,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