From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx192.postini.com [74.125.245.192]) by kanga.kvack.org (Postfix) with SMTP id 539D56B0068 for ; Tue, 17 Jul 2012 05:43:06 -0400 (EDT) Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Jul 2012 15:13:02 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6H9h0168651192 for ; Tue, 17 Jul 2012 15:13:00 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6HFDe9j029616 for ; Wed, 18 Jul 2012 01:13:41 +1000 From: Wanpeng Li Subject: [PATCH] mm/memcg: remove redundant checking on root memcg Date: Tue, 17 Jul 2012 17:42:27 +0800 Message-Id: <1342518147-10406-1-git-send-email-liwanp@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Cc: Michal Hocko , Johannes Weiner , KAMEZAWA Hiroyuki , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Gavin Shan , Wanpeng Li Function __mem_cgroup_cancel_local_charge is only called by mem_cgroup_move_parent. For this case, root memcg has been checked by mem_cgroup_move_parent. So we needn't check that again in function __mem_cgroup_cancel_local_charge and just remove the check in function __mem_cgroup_cancel_local_charge. Signed-off-by: Wanpeng Li --- mm/memcontrol.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6392c0a..d346347 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2404,9 +2404,6 @@ static void __mem_cgroup_cancel_local_charge(struct mem_cgroup *memcg, { unsigned long bytes = nr_pages * PAGE_SIZE; - if (mem_cgroup_is_root(memcg)) - return; - res_counter_uncharge_until(&memcg->res, memcg->res.parent, bytes); if (do_swap_account) res_counter_uncharge_until(&memcg->memsw, -- 1.7.5.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org