All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memcg: clean up checking of  the disabled flag
@ 2008-06-06  1:39 ` Li Zefan
  0 siblings, 0 replies; 8+ messages in thread
From: Li Zefan @ 2008-06-06  1:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Paul Menage, Balbir Singh, KAMEZAWA Hiroyuki, LKML,
	linux-mm@kvack.org

Those checks are unnecessary, because when the subsystem is disabled
it can't be mounted, so those functions won't get called.

The check is needed in functions which will be called in other places
except cgroup.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 memcontrol.c |    8 --------
 1 file changed, 8 deletions(-)

--- a/mm/memcontrol.c	2008-06-06 09:15:56.000000000 +0800
+++ b/mm/memcontrol.c	2008-06-06 09:09:04.000000000 +0800
@@ -845,9 +845,6 @@ static int mem_cgroup_force_empty(struct
 	int ret = -EBUSY;
 	int node, zid;
 
-	if (mem_cgroup_subsys.disabled)
-		return 0;
-
 	css_get(&mem->css);
 	/*
 	 * page reclaim code (kswapd etc..) will move pages between
@@ -1105,8 +1102,6 @@ static void mem_cgroup_destroy(struct cg
 static int mem_cgroup_populate(struct cgroup_subsys *ss,
 				struct cgroup *cont)
 {
-	if (mem_cgroup_subsys.disabled)
-		return 0;
 	return cgroup_add_files(cont, ss, mem_cgroup_files,
 					ARRAY_SIZE(mem_cgroup_files));
 }
@@ -1119,9 +1114,6 @@ static void mem_cgroup_move_task(struct 
 	struct mm_struct *mm;
 	struct mem_cgroup *mem, *old_mem;
 
-	if (mem_cgroup_subsys.disabled)
-		return;
-
 	mm = get_task_mm(p);
 	if (mm == NULL)
 		return;

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

end of thread, other threads:[~2008-06-07  6:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06  1:39 [PATCH] memcg: clean up checking of the disabled flag Li Zefan
2008-06-06  1:39 ` Li Zefan
2008-06-06  1:55 ` Balbir Singh
2008-06-06  1:55   ` Balbir Singh
2008-06-06  1:55 ` KAMEZAWA Hiroyuki
2008-06-06  1:55   ` KAMEZAWA Hiroyuki
2008-06-07  6:47 ` KOSAKI Motohiro
2008-06-07  6:47   ` KOSAKI Motohiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.