lkml.org 
[lkml]   [2011]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] mm: memcg: keep root group unchanged if fail to create new
From
If the request is not to create root group and we fail to meet it, we'd leave
the root unchanged.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
--- a/mm/memcontrol.c Fri Dec 9 21:57:40 2011
+++ b/mm/memcontrol.c Sun Dec 11 09:04:48 2011
@@ -4849,8 +4849,10 @@ mem_cgroup_create(struct cgroup_subsys *
enable_swap_cgroup();
parent = NULL;
root_mem_cgroup = memcg;
- if (mem_cgroup_soft_limit_tree_init())
+ if (mem_cgroup_soft_limit_tree_init()) {
+ root_mem_cgroup = NULL;
goto free_out;
+ }
for_each_possible_cpu(cpu) {
struct memcg_stock_pcp *stock =
&per_cpu(memcg_stock, cpu);
@@ -4888,7 +4890,6 @@ mem_cgroup_create(struct cgroup_subsys *
return &memcg->css;
free_out:
__mem_cgroup_free(memcg);
- root_mem_cgroup = NULL;
return ERR_PTR(error);
}

\
 
 \ /
  Last update: 2011-12-11 02:21    [from the cache]
©2003-2011 Jasper Spaans