linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [mm][PATCH] Memory cgroup fix hierarchy selector
@ 2008-11-19 15:28 Balbir Singh
  0 siblings, 0 replies; only message in thread
From: Balbir Singh @ 2008-11-19 15:28 UTC (permalink / raw)
  To: linux-mm
  Cc: YAMAMOTO Takashi, Paul Menage, lizf, linux-kernel, Nick Piggin,
	David Rientjes, Pavel Emelianov, Dhaval Giani, Balbir Singh,
	Andrew Morton, KAMEZAWA Hiroyuki


Andrew and Li reviewed and found that we need to check for val being 1 or 0
for the root container as well. use_hierarchy's type is changed to bool.
We still continue to use the ease of write_X64 for writing to it and then
check if the values are sane.

Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
---

 mm/memcontrol.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN mm/memcontrol.c~memcg-fix-add-hierarchy-selector mm/memcontrol.c
--- linux-2.6.28-rc4/mm/memcontrol.c~memcg-fix-add-hierarchy-selector	2008-11-19 11:07:21.000000000 +0530
+++ linux-2.6.28-rc4-balbir/mm/memcontrol.c	2008-11-19 14:11:56.000000000 +0530
@@ -151,7 +151,7 @@ struct mem_cgroup {
 	/*
 	 * Should the accounting and control be hierarchical, per subtree?
 	 */
-	unsigned long use_hierarchy;
+	bool use_hierarchy;
 
 	int		obsolete;
 	atomic_t	refcnt;
@@ -1556,8 +1556,8 @@ static int mem_cgroup_hierarchy_write(st
 	 * For the root cgroup, parent_mem is NULL, we allow value to be
 	 * set if there are no children.
 	 */
-	if (!parent_mem || (!parent_mem->use_hierarchy &&
-				(val == 1 || val == 0))) {
+	if ((!parent_mem || !parent_mem->use_hierarchy) &&
+				(val == 1 || val == 0)) {
 		if (list_empty(&cont->children))
 			mem->use_hierarchy = val;
 		else
_

-- 
	Balbir

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-19 15:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-19 15:28 [mm][PATCH] Memory cgroup fix hierarchy selector Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox