From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH 2/2]: atomic_t: Remove volatile from atomic_t definition Date: Wed, 19 May 2010 12:54:49 -0700 (PDT) Message-ID: <20100519.125449.56392211.davem@davemloft.net> References: <20100519130327.GW2516@laptop> <20100519150132.GJ2237@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:32870 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753245Ab0ESTyl (ORCPT ); Wed, 19 May 2010 15:54:41 -0400 In-Reply-To: <20100519150132.GJ2237@linux.vnet.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: paulmck@linux.vnet.ibm.com Cc: npiggin@suse.de, torvalds@linux-foundation.org, anton@samba.org, akpm@linux-foundation.org, willy@linux.intel.com, benh@kernel.crashing.org, paulus@samba.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org From: "Paul E. McKenney" Date: Wed, 19 May 2010 08:01:32 -0700 > On Wed, May 19, 2010 at 11:03:27PM +1000, Nick Piggin wrote: >> For atomic_read it shouldn't matter unless gcc is *really* bad at it. >> Ah, for atomic_read, the required semantic is surely ACCESS_ONCE, so >> that's where the volatile is needed? (maybe it would be clearer to >> explicitly use ACCESS_ONCE?) > > Explicit use of ACCESS_ONCE() where needed makes a lot of sense to me, > and allows better code to be generated for initialization and cleanup > code where no other task has access to the atomic_t. I agree and I want to see this too, but I think with the tree the size that it is we have to work backwards at this point. Existing behavior by default, and optimized cases get tagged by using a new interface (atomic_read_light(), test_bit{,s}_light(), etc.)