Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754645AbaAWRi4 (ORCPT ); Thu, 23 Jan 2014 12:38:56 -0500 Received: from merlin.infradead.org ([205.233.59.134]:40526 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416AbaAWRiy (ORCPT ); Thu, 23 Jan 2014 12:38:54 -0500 Date: Thu, 23 Jan 2014 18:38:12 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Waiman Long , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , "linux-arch@vger.kernel.org" , the arch/x86 maintainers , Linux Kernel Mailing List , Steven Rostedt , Andrew Morton , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Raghavendra K T , George Spelvin , Tim Chen , "Chandramouleeswaran, Aswin" , Scott J Norton Subject: Re: [PATCH v10 1/4] qrwlock: A queue read/write lock implementation Message-ID: <20140123173812.GZ31570@twins.programming.kicks-ass.net> References: <1390426438-31252-1-git-send-email-Waiman.Long@hp.com> <1390426438-31252-2-git-send-email-Waiman.Long@hp.com> <20140123100751.GS30183@twins.programming.kicks-ass.net> <52E14D67.4000202@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23, 2014 at 09:15:38AM -0800, Linus Torvalds wrote: > On Thu, Jan 23, 2014 at 9:12 AM, Waiman Long wrote: > > > > I thought that all atomic RMW instructions are memory barrier. > > On x86 they are. Not necessarily elsewhere. > > > If they are not, what kind of barrier should be added? > > smp_mb__before_atomic_xyz() and smp_mb__after_atomic_xyz() will do it, > and are no-op (well, barriers - I don't think it matters) on x86. Right, which on PPC are sync, whereas the release need only have lwsync. And ARM can actually do atomic_sub_release() but cannot do it with an additional smp_*__after() construct. Do we care enough to introduce atomic_sub_release() for them? -- 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/