From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by kanga.kvack.org (Postfix) with ESMTP id 1272E900138 for ; Wed, 17 Aug 2011 20:47:38 -0400 (EDT) Received: from m1.gw.fujitsu.co.jp (unknown [10.0.50.71]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id A23763EE0C0 for ; Thu, 18 Aug 2011 09:47:34 +0900 (JST) Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 882683266C1 for ; Thu, 18 Aug 2011 09:47:34 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 6E8D545DE56 for ; Thu, 18 Aug 2011 09:47:34 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 405EE1DB804B for ; Thu, 18 Aug 2011 09:47:34 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.240.81.147]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 028081DB8052 for ; Thu, 18 Aug 2011 09:47:34 +0900 (JST) Date: Thu, 18 Aug 2011 09:39:59 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH v9 03/13] memcg: add dirty page accounting infrastructure Message-Id: <20110818093959.cdf501ae.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <1313597705-6093-4-git-send-email-gthelen@google.com> References: <1313597705-6093-1-git-send-email-gthelen@google.com> <1313597705-6093-4-git-send-email-gthelen@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Greg Thelen Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, containers@lists.osdl.org, linux-fsdevel@vger.kernel.org, Balbir Singh , Daisuke Nishimura , Minchan Kim , Johannes Weiner , Wu Fengguang , Dave Chinner , Vivek Goyal , Andrea Righi , Ciju Rajan K , David Rientjes On Wed, 17 Aug 2011 09:14:55 -0700 Greg Thelen wrote: > Add memcg routines to count dirty, writeback, and unstable_NFS pages. > These routines are not yet used by the kernel to count such pages. A > later change adds kernel calls to these new routines. > > As inode pages are marked dirty, if the dirtied page's cgroup differs > from the inode's cgroup, then mark the inode shared across several > cgroup. > > Signed-off-by: Greg Thelen > Signed-off-by: Andrea Righi Acked-by: KAMEZAWA Hiroyuki A nitpick.. > +static inline > +void mem_cgroup_move_account_page_stat(struct mem_cgroup *from, > + struct mem_cgroup *to, > + enum mem_cgroup_stat_index idx) > +{ > + preempt_disable(); > + __this_cpu_dec(from->stat->count[idx]); > + __this_cpu_inc(to->stat->count[idx]); > + preempt_enable(); > +} > + this_cpu_dec() this_cpu_inc() without preempt_disable/enable will work. CPU change between dec/inc will not be problem. 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