From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161044AbcFCTNt (ORCPT ); Fri, 3 Jun 2016 15:13:49 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45117 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932268AbcFCTNs (ORCPT ); Fri, 3 Jun 2016 15:13:48 -0400 Date: Fri, 3 Jun 2016 21:13:14 +0200 From: Peter Zijlstra To: Will Deacon Cc: Boqun Feng , linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, manfred@colorfullife.com, dave@stgolabs.net, paulmck@linux.vnet.ibm.com, Waiman.Long@hpe.com, tj@kernel.org, pablo@netfilter.org, kaber@trash.net, davem@davemloft.net, oleg@redhat.com, netfilter-devel@vger.kernel.org, sasha.levin@oracle.com, hofrat@osadl.org, jejb@parisc-linux.org, chris@zankel.net, rth@twiddle.net, dhowells@redhat.com, schwidefsky@de.ibm.com, mpe@ellerman.id.au, ralf@linux-mips.org, linux@armlinux.org.uk, rkuo@codeaurora.org, vgupta@synopsys.com, james.hogan@imgtec.com, realmz6@gmail.com, ysato@users.sourceforge.jp, tony.luck@intel.com, cmetcalf@mellanox.com, "H. Peter Anvin" Subject: Re: [PATCH -v4 5/7] locking, arch: Update spin_unlock_wait() Message-ID: <20160603191314.GA3710@twins.programming.kicks-ass.net> References: <20160602115157.249037373@infradead.org> <20160602115439.085385545@infradead.org> <20160602142440.GE30064@insomnia> <20160602144424.GV3193@twins.programming.kicks-ass.net> <20160602163425.GV3205@twins.programming.kicks-ass.net> <20160602175659.GB7697@arm.com> <20160602215119.GF3190@twins.programming.kicks-ass.net> <20160603124734.GK9915@arm.com> <20160603134249.GA3693@twins.programming.kicks-ass.net> <20160603173537.GR9915@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160603173537.GR9915@arm.com> 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 Fri, Jun 03, 2016 at 06:35:37PM +0100, Will Deacon wrote: > On Fri, Jun 03, 2016 at 03:42:49PM +0200, Peter Zijlstra wrote: > > On Fri, Jun 03, 2016 at 01:47:34PM +0100, Will Deacon wrote: > > > Even on x86, I think you need a fence here: > > > > > > X86 lock > > > { > > > } > > > P0 | P1 ; > > > MOV EAX,$1 | MOV EAX,$1 ; > > > LOCK XCHG [x],EAX | LOCK XCHG [y],EAX ; > > > MOV EBX,[y] | MOV EBX,[x] ; > > > exists > > > (0:EAX=0 /\ 0:EBX=0 /\ 1:EAX=0 /\ 1:EBX=0) > > > > > > is permitted by herd. > > > > I am puzzled.. this should not be. You say adding MFENCE after LOCK XCHG > > makes it 'work', but we assume LOCK is a full fence all over the > > place. > > > > I'm thinking herd is busted. > > FWIW -- I spoke to the Herd authors and they confirmed that this is a > regresion in herd (fixed in the bleeding edge version). Good, means I'm not slowly going crazeh -- or at least, this isn't one of the signs :-)