Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757259AbXHQTtm (ORCPT ); Fri, 17 Aug 2007 15:49:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752454AbXHQTtb (ORCPT ); Fri, 17 Aug 2007 15:49:31 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:40093 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbXHQTt3 (ORCPT ); Fri, 17 Aug 2007 15:49:29 -0400 Date: Fri, 17 Aug 2007 12:49:24 -0700 From: "Paul E. McKenney" To: Arjan van de Ven Cc: Chris Friesen , Linus Torvalds , Nick Piggin , Satyam Sharma , Herbert Xu , Paul Mackerras , Christoph Lameter , Chris Snook , Ilpo Jarvinen , Stefan Richter , Linux Kernel Mailing List , linux-arch@vger.kernel.org, Netdev , Andrew Morton , ak@suse.de, heiko.carstens@de.ibm.com, David Miller , schwidefsky@de.ibm.com, wensong@linux-vs.org, horms@verge.net.au, wjiang@resilience.com, zlynx@acm.org, rpjday@mindspring.com, jesper.juhl@gmail.com, segher@kernel.crashing.org Subject: Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures Message-ID: <20070817194924.GG8464@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20070817035342.GA14744@gondor.apana.org.au> <46C55E90.7010407@yahoo.com.au> <46C56ADF.8010501@cyberone.com.au> <46C59717.4020108@cyberone.com.au> <46C5EDF9.3090507@nortel.com> <1187376873.2615.2.camel@laptopd505.fenrus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1187376873.2615.2.camel@laptopd505.fenrus.org> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 34 On Fri, Aug 17, 2007 at 11:54:33AM -0700, Arjan van de Ven wrote: > > On Fri, 2007-08-17 at 12:50 -0600, Chris Friesen wrote: > > Linus Torvalds wrote: > > > > > - in other words, the *only* possible meaning for "volatile" is a purely > > > single-CPU meaning. And if you only have a single CPU involved in the > > > process, the "volatile" is by definition pointless (because even > > > without a volatile, the compiler is required to make the C code appear > > > consistent as far as a single CPU is concerned). > > > > I assume you mean "except for IO-related code and 'random' values like > > jiffies" as you mention later on? I assume other values set in > > interrupt handlers would count as "random" from a volatility perspective? > > > > > So anybody who argues for "volatile" fixing bugs is fundamentally > > > incorrect. It does NO SUCH THING. By arguing that, such people only show > > > that you have no idea what they are talking about. > > > > What about reading values modified in interrupt handlers, as in your > > "random" case? Or is this a bug where the user of atomic_read() is > > invalidly expecting a read each time it is called? > > the interrupt handler case is an SMP case since you do not know > beforehand what cpu your interrupt handler will run on. With the exception of per-CPU variables, yes. Thanx, Paul - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/