linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memcg: keep root group unchanged if fail to create new
@ 2011-12-11  1:19 Hillf Danton
  2011-12-11 23:39 ` Hugh Dickins
  2011-12-12  0:52 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 13+ messages in thread
From: Hillf Danton @ 2011-12-11  1:19 UTC (permalink / raw)
  To: Balbir Singh
  Cc: David Rientjes, Hugh Dickins, Andrea Arcangeli, Andrew Morton,
	linux-mm, LKML

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);
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-12-14  1:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11  1:19 [PATCH] mm: memcg: keep root group unchanged if fail to create new Hillf Danton
2011-12-11 23:39 ` Hugh Dickins
2011-12-12 12:48   ` Hillf Danton
2011-12-12 13:11   ` Michal Hocko
2011-12-12 13:49     ` Hillf Danton
2011-12-12 14:07       ` Michal Hocko
2011-12-12 14:09         ` [PATCH] memcg: clean up soft_limit_tree properly new Michal Hocko
2011-12-13 14:08           ` Johannes Weiner
2011-12-13 14:19             ` Michal Hocko
2011-12-14  1:00           ` Andrew Morton
2011-12-14  1:16             ` KAMEZAWA Hiroyuki
2011-12-13 14:05       ` [PATCH] mm: memcg: keep root group unchanged if fail to create new Johannes Weiner
2011-12-12  0:52 ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).