From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [patch] Re: using long instead of atomic_t when only set/read is required Date: Tue, 4 Mar 2008 04:16:33 +1100 Message-ID: <200803040416.33937.nickpiggin@yahoo.com.au> References: <20080303120842.GA28369@elf.ucw.cz> <20080303155330.39e45ad4@core> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080303155330.39e45ad4@core> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Alan Cox Cc: Andrew Morton , Kernel development list , Zdenek Kabelac , pm list , "Paul E. McKenney" , Linus Torvalds , davem@davemloft.net, Pierre Ossman List-Id: linux-pm@vger.kernel.org On Tuesday 04 March 2008 02:53, Alan Cox wrote: > > Atomicity of reads of write for pointers and integral types (other than > > long long) should be documented. > > NAK. > > Atomicity of reads or writes for pointers and integral types is NOT > guaranteed. Gcc doesn't believe in your guarantee. Are you sure gcc doesn't? Or is it just "C"? Linux wouldn't work today if gcc did something non-atomic there (presuming you're talking about naturally aligned pointers/ints). It is widely used and accepted. RCU users are far from the only places to rely on this, although I guess they are the main ones when it comes to assigning pointers atomically.