From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with ESMTP id EE1816B004F for ; Thu, 13 Aug 2009 03:28:39 -0400 (EDT) Date: Thu, 13 Aug 2009 16:26:40 +0900 From: Daisuke Nishimura Subject: Re: [PATCH][mmotm] Help Root Memory Cgroup Resource Counters Scale Better (v5) Message-Id: <20090813162640.fe2349e9.nishimura@mxp.nes.nec.co.jp> In-Reply-To: <20090813065504.GG5087@balbir.in.ibm.com> References: <20090813065504.GG5087@balbir.in.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: balbir@linux.vnet.ibm.com Cc: Andrew Morton , "lizf@cn.fujitsu.com" , KAMEZAWA Hiroyuki , "menage@google.com" , xemul@openvz.org, prarit@redhat.com, andi.kleen@intel.com, nishimura@mxp.nes.nec.co.jp, "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" List-ID: > @@ -1855,9 +1883,14 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype) > break; > } > > - res_counter_uncharge(&mem->res, PAGE_SIZE, &soft_limit_excess); > - if (do_swap_account && (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT)) > - res_counter_uncharge(&mem->memsw, PAGE_SIZE, NULL); > + if (!mem_cgroup_is_root(mem)) { > + res_counter_uncharge(&mem->res, PAGE_SIZE, &soft_limit_excess); > + if (do_swap_account && > + (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT)) > + res_counter_uncharge(&mem->memsw, PAGE_SIZE, NULL); > + } > + if (ctype == MEM_CGROUP_CHARGE_TYPE_SWAPOUT && mem_cgroup_is_root(mem)) > + mem_cgroup_swap_statistics(mem, true); Hmm, if we don't count MEM_CGROUP_STAT_SWAPOUT properly about other groups than the root, memsw.usage_in_bytes of the root would be incorrect in use_hierarchy==1 case, right? > mem_cgroup_charge_statistics(mem, pc, false); > > ClearPageCgroupUsed(pc); Thanks, Daisuke Nishimura. -- 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