From: Daisuke Nishimura Date: Thu, 8 Jan 2009 02:08:13 +0000 (-0800) Subject: memcg: hierarchy avoid unnecessary reclaim X-Git-Tag: v2.6.29-rc1~116 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=670ec2f170301425fc4fdfa63d40652071fe85f6;p=linux-2.6-omap-h63xx.git memcg: hierarchy avoid unnecessary reclaim If hierarchy is not used, no tree-walk is necessary. Reviewed-by: KOSAKI Motohiro Signed-off-by: Daisuke Nishimura Signed-off-by: KAMEZAWA Hiroyuki Cc: Balbir Singh Cc: Daisuke Nishimura Cc: Hugh Dickins Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 964a70035e8..9b4993ee46b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -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);