Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754251Ab2FYIon (ORCPT ); Mon, 25 Jun 2012 04:44:43 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:39411 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667Ab2FYIom (ORCPT ); Mon, 25 Jun 2012 04:44:42 -0400 From: Wanpeng Li To: Michal Hocko Cc: Johannes Weiner , KAMEZAWA Hiroyuki , Balbir Singh , Andrew Morton , Eric Dumazet , Mike Frysinger , Arun Sharma , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Wanpeng Li Subject: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit Date: Mon, 25 Jun 2012 16:44:32 +0800 Message-Id: <1340613872-9581-1-git-send-email-liwp.linux@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 987 Lines: 32 From: Wanpeng Li Optimize memcg_get_hierarchical_limit to save cpu cycle. Signed-off-by: Wanpeng Li --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/