memcg: hierarchy avoid unnecessary reclaim
authorDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Thu, 8 Jan 2009 02:08:13 +0000 (18:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jan 2009 16:31:07 +0000 (08:31 -0800)
If hierarchy is not used, no tree-walk is necessary.

Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c

index 964a70035e8f9ef24a8777e0db9c1c1d854a4273..9b4993ee46b315187600f48cac8236cebd7c46af 100644 (file)
@@ -606,6 +606,8 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
        ret = try_to_free_mem_cgroup_pages(root_mem, gfp_mask, noswap);
        if (mem_cgroup_check_under_limit(root_mem))
                return 0;
+       if (!root_mem->use_hierarchy)
+               return ret;
 
        next_mem = mem_cgroup_get_first_node(root_mem);