From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx180.postini.com [74.125.245.180]) by kanga.kvack.org (Postfix) with SMTP id B68506B0081 for ; Mon, 14 May 2012 22:49:10 -0400 (EDT) Received: from m4.gw.fujitsu.co.jp (unknown [10.0.50.74]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 047593EE0CE for ; Tue, 15 May 2012 11:49:09 +0900 (JST) Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id A8A3B45DE55 for ; Tue, 15 May 2012 11:49:08 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id 8517345DE4F for ; Tue, 15 May 2012 11:49:08 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 589BD1DB8042 for ; Tue, 15 May 2012 11:49:08 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.240.81.134]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 06987E08003 for ; Tue, 15 May 2012 11:49:08 +0900 (JST) Message-ID: <4FB1C398.1010000@jp.fujitsu.com> Date: Tue, 15 May 2012 11:46:48 +0900 From: KAMEZAWA Hiroyuki MIME-Version: 1.0 Subject: Re: [PATCH v2 19/29] skip memcg kmem allocations in specified code regions References: <1336758272-24284-1-git-send-email-glommer@parallels.com> <1336758272-24284-20-git-send-email-glommer@parallels.com> In-Reply-To: <1336758272-24284-20-git-send-email-glommer@parallels.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Glauber Costa Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Tejun Heo , Li Zefan , Greg Thelen , Suleiman Souhlal , Michal Hocko , Johannes Weiner , devel@openvz.org, Christoph Lameter , Pekka Enberg (2012/05/12 2:44), Glauber Costa wrote: > This patch creates a mechanism that skip memcg allocations during > certain pieces of our core code. It basically works in the same way > as preempt_disable()/preempt_enable(): By marking a region under > which all allocations will be accounted to the root memcg. > > We need this to prevent races in early cache creation, when we > allocate data using caches that are not necessarily created already. > > Signed-off-by: Glauber Costa > CC: Christoph Lameter > CC: Pekka Enberg > CC: Michal Hocko > CC: Kamezawa Hiroyuki > CC: Johannes Weiner > CC: Suleiman Souhlal The concept seems okay to me but... > --- > include/linux/sched.h | 1 + > mm/memcontrol.c | 25 +++++++++++++++++++++++++ > 2 files changed, 26 insertions(+), 0 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 81a173c..0501114 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1613,6 +1613,7 @@ struct task_struct { > unsigned long nr_pages; /* uncharged usage */ > unsigned long memsw_nr_pages; /* uncharged mem+swap usage */ > } memcg_batch; > + atomic_t memcg_kmem_skip_account; If only 'current' thread touch this, you don't need to make this atomic counter. you can use 'long'. Thanks, -Kame -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org