diff options
author | Hillf Danton <dhillf@gmail.com> | 2011-12-19 17:11:57 -0800 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-01-11 10:09:42 -0800 |
commit | 80a0fa253a80b06aa878cf2bed56cb1de5d16e69 (patch) | |
tree | 7decbfb462b7a214f6cbb6d104003520fbea3156 /mm | |
parent | ddfac9fdac892d6f1040bede4d8067d9f8845844 (diff) |
memcg: keep root group unchanged if creation fails
commit a41c58a6665cc995e237303b05db42100b71b65e upstream.
If the request is to create non-root group and we fail to meet it, we
should leave the root unchanged.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Change-Id: Ib38fb531508f5c250e9e52f6dc3432db32c315ad
Reviewed-on: http://git-master/r/74192
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3508777837c7..afde618f9895 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4898,9 +4898,9 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) int cpu; enable_swap_cgroup(); parent = NULL; - root_mem_cgroup = mem; if (mem_cgroup_soft_limit_tree_init()) goto free_out; + root_mem_cgroup = mem; for_each_possible_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); @@ -4939,7 +4939,6 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) return &mem->css; free_out: __mem_cgroup_free(mem); - root_mem_cgroup = NULL; return ERR_PTR(error); } |