brcm2708: switch to linux 4.4 and update patches
[openwrt.git] / target / linux / brcm2708 / patches-4.1 / 0033-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch
1 From 392071fc3afa61f49617e9f5386f128ebd47e18e 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 033/222] 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  mm/memcontrol.c |  1 +
10  2 files changed, 24 insertions(+)
11
12 --- a/kernel/cgroup.c
13 +++ b/kernel/cgroup.c
14 @@ -5394,6 +5394,29 @@ static int __init cgroup_disable(char *s
15  }
16  __setup("cgroup_disable=", cgroup_disable);
17  
18 +static int __init cgroup_enable(char *str)
19 +{
20 +       struct cgroup_subsys *ss;
21 +       char *token;
22 +       int i;
23 +
24 +       while ((token = strsep(&str, ",")) != NULL) {
25 +               if (!*token)
26 +                       continue;
27 +
28 +               for_each_subsys(ss, i) {
29 +                       if (!strcmp(token, ss->name)) {
30 +                               ss->disabled = 0;
31 +                               printk(KERN_INFO "Enabling %s control group"
32 +                                       " subsystem\n", ss->name);
33 +                               break;
34 +                       }
35 +               }
36 +       }
37 +       return 1;
38 +}
39 +__setup("cgroup_enable=", cgroup_enable);
40 +
41  static int __init cgroup_set_legacy_files_on_dfl(char *str)
42  {
43         printk("cgroup: using legacy files on the default hierarchy\n");
44 --- a/mm/memcontrol.c
45 +++ b/mm/memcontrol.c
46 @@ -5389,6 +5389,7 @@ struct cgroup_subsys memory_cgrp_subsys
47         .dfl_cftypes = memory_files,
48         .legacy_cftypes = mem_cgroup_legacy_files,
49         .early_init = 0,
50 +        .disabled = 1,
51  };
52  
53  /**