From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964902AbcIFRmG (ORCPT ); Tue, 6 Sep 2016 13:42:06 -0400 Received: from foss.arm.com ([217.140.101.70]:60688 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933062AbcIFRmF (ORCPT ); Tue, 6 Sep 2016 13:42:05 -0400 Date: Tue, 6 Sep 2016 18:42:10 +0100 From: Will Deacon To: Peter Zijlstra Cc: Linus Torvalds , Oleg Nesterov , Paul McKenney , Benjamin Herrenschmidt , Michael Ellerman , linux-kernel@vger.kernel.org, Nicholas Piggin , Ingo Molnar , Alan Stern Subject: Re: Question on smp_mb__before_spinlock Message-ID: <20160906174209.GB29382@arm.com> References: <20160905093753.GN10138@twins.programming.kicks-ass.net> <20160905101021.GC2649@arm.com> <20160906111753.GA10121@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160906111753.GA10121@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2016 at 01:17:53PM +0200, Peter Zijlstra wrote: > On Mon, Sep 05, 2016 at 11:10:22AM +0100, Will Deacon wrote: > > > > The second issue I wondered about is spinlock transitivity. All except > > > powerpc have RCsc locks, and since Power already does a full mb, would > > > it not make sense to put it _after_ the spin_lock(), which would provide > > > the same guarantee, but also upgrades the section to RCsc. > > > > > > That would make all schedule() calls fully transitive against one > > > another. > > > > It would also match the way in which the arm64 atomic_*_return ops > > are implemented, since full barrier semantics are required there. > > Hmm, are you sure; the way I read arch/arm64/include/asm/atomic_ll_sc.h > is that you do ll/sc-rel + mb. Yes, all I meant was that we put the full barrier at the end, but the two things are indeed different sequences. Will