From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Date: Fri, 30 Aug 2013 12:45:02 +1000 Message-ID: <1377830702.4028.50.camel@pasglop> References: <1375758759-29629-1-git-send-email-Waiman.Long@hp.com> <1375758759-29629-2-git-send-email-Waiman.Long@hp.com> <1377751465.4028.20.camel@pasglop> <20130829070012.GC27322@gmail.com> <1377822408.4028.44.camel@pasglop> <29797.1377828380@ale.ozlabs.ibm.com> <1377829857.4028.46.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Michael Neuling , Ingo Molnar , Waiman Long , Alexander Viro , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" To: Linus Torvalds Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 2013-08-29 at 19:35 -0700, Linus Torvalds wrote: > That said, on power, you have that "ACCESS_ONCE()" implicit in the > *type*, not in the code, so an "arch_spinlock_t" is fundamentally > volatile in itself. It's one of the reasons I despise "volatile": > things like volatility are _not_ attributes of a variable or a type, > but of the code in question. Something can be volatile in one context, > but not in another (one context might be locked, for example). Right, we can probably change that to use ACCESS_ONCE... volatile tend to never quite do what you expect anyway. Cheers, Ben.