From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753713AbeCFNBP (ORCPT ); Tue, 6 Mar 2018 08:01:15 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:39692 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbeCFNBO (ORCPT ); Tue, 6 Mar 2018 08:01:14 -0500 Date: Tue, 6 Mar 2018 14:00:59 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Will Deacon , Luc Maranget , Daniel Lustig , "Paul E. McKenney" , Andrea Parri , Linux Kernel Mailing List , Palmer Dabbelt , Albert Ou , Alan Stern , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Akira Yokosawa , Ingo Molnar , linux-riscv@lists.infradead.org Subject: Re: [RFC PATCH] riscv/locking: Strengthen spin_lock() and spin_unlock() Message-ID: <20180306130059.GE25201@hirez.programming.kicks-ass.net> References: <20180222134004.GN25181@hirez.programming.kicks-ass.net> <20180222141249.GA14033@andrea> <82beae6a-2589-6136-b563-3946d7c4fc60@nvidia.com> <20180222181317.GI2855@linux.vnet.ibm.com> <20180222182717.GS25181@hirez.programming.kicks-ass.net> <563431d0-4fb5-9efd-c393-83cc5197e934@nvidia.com> <20180226142107.uid5vtv5r7zbso33@yquem.inria.fr> <20180226162426.GB17158@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 26, 2018 at 09:00:43AM -0800, Linus Torvalds wrote: > On Mon, Feb 26, 2018 at 8:24 AM, Will Deacon wrote: > > > > Strictly speaking, that's not what we've got implemented on arm64: only > > the read part of the RmW has Acquire semantics, but there is a total > > order on the lock/unlock operations for the lock. > > Hmm. > > I thought we had exactly that bug on some architecture with the queued > spinlocks, and people decided it was wrong. So ARM64 and Power have the acquire-on-load only thing, but qspinlock has it per construction on anything that allowes reordering stores. Given that unlock/lock are ordered, which covers about 99% of the users out there, and fixing the issue would make things significantly slower on the weak architectures we let it be. But yes, its a pesky detail.