Received: by 10.223.185.116 with SMTP id b49csp3783762wrg; Tue, 6 Mar 2018 05:02:55 -0800 (PST) X-Google-Smtp-Source: AG47ELu3QcVufvJmuqt2TzHdQdqwgdrqRfRCCpr32gAXfkhgjipOhOxWwoq0e0whPdBF3/rTMrR1 X-Received: by 2002:a17:902:57db:: with SMTP id g27-v6mr16281939plj.75.1520341375727; Tue, 06 Mar 2018 05:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520341375; cv=none; d=google.com; s=arc-20160816; b=HX97f9rUThkbtBviKXid1DRoi5ZwTNKot+lrpjsERg+7XAIlEPRNUXLhK6NpYdRUjl vbo1axD1HKhLfJHJ6iPSRWR+KBDyw35RfPJSJ6avas7u5vlE9vTm0pRjhb7KNb1TmaiQ iH5odDiCret627D3VfQYYVCxKZziSlKzTxh8NVpSxrXVGkhnM4YcvjHw9nzWJcFFxxgz 7Vd4+qp2hxX3L733vN2Qxgugi5LCnyU5bw5kLLFQAQbZeVW31ikAsIDUq+aC9QY2BmlA w96lzOmlQFtvgU/6gmmCHH/xp7wGHfdsWdyQilC42pVhRG+HnXKArmOsnC/QAWuZXSR4 xq4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=1BkKkirxu8SwH58stnH3u3I6g3CAA8AcpPFzhhffRlM=; b=tOg8VfemieZAOXyRWnEKutDd9CQ7F1f277a53NAbajXYpH35fzyHbMLxpCd0um6hSi Kr1bqPIZFLWO6a/xQsOMbtjBN2pMBYPRmyi5Su59GEYAOENOHqo8HK4u45qbZ9j3/FaZ qjFuIcwzNY1NueLEv/KsCseI9Gyw745IaCyVAG3wQ+sI/zp1QuBCUdbw+FEcURMp6mUd QXZ2lhx8lDqacni1JBV70S2eCotlqwMQIjdE0bE+ty91wrOvRoiRor/xcmRMJbe1PrhE 5svIkX0Qd/30t/I2XsdbTzNx9+JficFhrlj4DgXeHU46LRqOZkcoSt1w9eB9+15lS7kM OlNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gN8zOmPr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si11120176plb.717.2018.03.06.05.02.40; Tue, 06 Mar 2018 05:02:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gN8zOmPr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673AbeCFNBP (ORCPT + 99 others); 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1BkKkirxu8SwH58stnH3u3I6g3CAA8AcpPFzhhffRlM=; b=gN8zOmPrjd1Nxb7Sjg9mTCKm1 Ejl8X6eTLqcz3J9C5hYXK8Kfps59hJPeKpjtR2GksU7skY29HWXfdkBoGttrTTdr/1hZhhfJROIH0 cpy3FIubH3oxo6gTwwiaJpGHcQexRR5ZQJojW6tzKVwqCw9NJdEoWz/W+7I3JObYnrnVNKTLBB1df A2AKV+K56v3EKRjO4CI1hhy3CRy7MAsPDE8trgdncBIZa7E5SoM83Z3BAlNNmU5Mufu9s3+Hz8eK9 AqtinEAxvNNpLlnInSijqSGJL9oloUMaIShhjiyDQF/1GtKdu7O+CKM29nd+8BlIUAUVNcnNcGqgJ k7BgoEu4g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1etCDG-0001AZ-AT; Tue, 06 Mar 2018 13:01:02 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 00F63201EF2AE; Tue, 6 Mar 2018 14:00:59 +0100 (CET) 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 Precedence: bulk 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.