From: Daisuke Nishimura Date: Thu, 8 Jan 2009 02:08:13 +0000 (-0800) Subject: memcg: hierarchy avoid unnecessary reclaim X-Git-Tag: v3.0~11067 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=670ec2f170301425fc4fdfa63d40652071fe85f6;p=platform%2Fkernel%2Flinux-amlogic.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 964a700..9b4993e 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);