* [PATCH 4/5 v2] memcg: optimize memcg_get_hierarchical_limit
@ 2012-06-25 6:06 Wanpeng Li
0 siblings, 0 replies; only message in thread
From: Wanpeng Li @ 2012-06-25 6:06 UTC (permalink / raw)
To: Michal Hocko
Cc: Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton,
Eric Dumazet, Mike Frysinger, Arun Sharma,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
cgroups-u79uwXL29TY76Z2rM5mHXA, 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 2e81328..4520b57 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] only message in thread
only message in thread, other threads:[~2012-06-25 6:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 6:06 [PATCH 4/5 v2] memcg: optimize memcg_get_hierarchical_limit Wanpeng Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).