Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755149Ab3H3Ccd (ORCPT ); Thu, 29 Aug 2013 22:32:33 -0400 Received: from gate.crashing.org ([63.228.1.57]:45728 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752282Ab3H3Ccb (ORCPT ); Thu, 29 Aug 2013 22:32:31 -0400 Message-ID: <1377829857.4028.46.camel@pasglop> Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount From: Benjamin Herrenschmidt To: Michael Neuling Cc: Linus Torvalds , 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" Date: Fri, 30 Aug 2013 12:30:57 +1000 In-Reply-To: <29797.1377828380@ale.ozlabs.ibm.com> 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 843 Lines: 29 On Fri, 2013-08-30 at 12:06 +1000, Michael Neuling wrote: > powerpc patch below. I'm using arch_spin_is_locked() to implement > arch_spin_value_unlocked(). > > +static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock) > +{ > + return !arch_spin_is_locked(&lock); > +} > + Arguably, it should be done the other way around :-) arch_spin_value_unlocked semantics is to basically operate on an already read copy of the value, while arch_spin_is_locked() has ACCESS_ONE semantics on *top* of that. Or we can keep both completely separate like Linus does on x86. Cheers, Ben. -- 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/