From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with SMTP id 0679B6B016C for ; Thu, 25 Aug 2011 15:19:30 -0400 (EDT) Date: Thu, 25 Aug 2011 14:19:26 -0500 (CDT) From: Christoph Lameter Subject: Re: [PATCH] memcg: remove unneeded preempt_disable In-Reply-To: <1314299115.26922.2.camel@twins> Message-ID: References: <1313650253-21794-1-git-send-email-gthelen@google.com> <20110818144025.8e122a67.akpm@linux-foundation.org> <1314284272.27911.32.camel@twins> <1314289208.3268.4.camel@mulgrave> <986ca4ed-6810-426f-b32f-5c8687e3a10b@email.android.com> <1e295500-5d1f-45dd-aa5b-3d2da2cf1a62@email.android.com> <1314299115.26922.2.camel@twins> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Peter Zijlstra Cc: James Bottomley , Andrew Morton , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, KAMEZAWA Hiroyuki , Balbir Singh , Daisuke Nishimura , linux-arch@vger.kernel.org On Thu, 25 Aug 2011, Peter Zijlstra wrote: > Also, I thought this_cpu thing's were at best locally atomic. If you > make them full blown atomic ops then even __this_cpu ops will have to be > full atomic ops, otherwise: > > > CPU0 CPU(1) > > this_cpu_inc(&foo); preempt_disable(); > __this_cpu_inc(&foo); > preempt_enable(); > > might step on each other's toes. They would both have their own instance of "foo". per cpu atomicity is only one requirement of this_cpu_ops. The other is the ability to relocate accesses relative to the current per cpu area. Full blown atomicity is almost a superset of per cpu atomicity but its only usable if the full atomic instructions can also relocate accesses relative to some base. -- 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