All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/6] memcg: optimize memcg_get_hierarchical_limit
@ 2012-06-23  6:18 ` Wanpeng Li
  0 siblings, 0 replies; 7+ messages in thread
From: Wanpeng Li @ 2012-06-23  6:18 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg
  Cc: Michal Hocko, Johannes Weiner, Balbir Singh, KAMEZAWA Hiroyuki,
	Andrew Morton, Mel Gorman, Minchan Kim,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	cgroups-u79uwXL29TY76Z2rM5mHXA, Gavin Shan, Wanpeng Li

From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

Optimize memcg_get_hierarchical_limit to save cpu cycle.

Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 mm/memcontrol.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c821e36..1ca79e2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
 
 	min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT);
 	min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
-	cgroup = memcg->css.cgroup;
 	if (!memcg->use_hierarchy)
 		goto out;
+	cgroup = memcg->css.cgroup;
 
 	while (cgroup->parent) {
 		cgroup = cgroup->parent;
-- 
1.7.9.5

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

end of thread, other threads:[~2012-06-25  8:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-23  6:18 [PATCH 5/6] memcg: optimize memcg_get_hierarchical_limit Wanpeng Li
2012-06-23  6:18 ` Wanpeng Li
2012-06-23  6:18 ` Wanpeng Li
2012-06-23  9:39 ` Johannes Weiner
2012-06-23  9:39   ` Johannes Weiner
2012-06-25  8:14 ` Glauber Costa
2012-06-25  8:14   ` Glauber Costa

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.