Received: by 10.223.185.116 with SMTP id b49csp3590366wrg; Mon, 26 Feb 2018 02:40:29 -0800 (PST) X-Google-Smtp-Source: AG47ELt3AOEte6BaN8gzqgZvXuzUvBd0XoTayAOYS+3WwkWMRjsFeLV9B5rUqP2YGiNeM3/O04+9 X-Received: by 2002:a17:902:3341:: with SMTP id a59-v6mr5195438plc.20.1519641629156; Mon, 26 Feb 2018 02:40:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519641629; cv=none; d=google.com; s=arc-20160816; b=FBg+ZhdKVPEMNf9m7/JfNrpUCh9xda0N9hcmy40IDz1IzrYCnntEACzBV6swOAwPad 69tj04ltPet5G2P58Vxk1FoxC7PSvA9NXaCkjiAGz464DdPQVFEgYyTpj9iQT/NNRxRf pciUUSD4s2SCs+w0mllCsIbAT+hf1dYgiOci5NoH50YLp9ZspCKgVXMkDXPtgNy8PPjL /+SvDZPczQDAL5iHv/cD55x3iVbnWZxl1NitmvbpNvse+DkDcKt4E/4WXpx7s18IemNj Kfnpa4oxodHaaNRXAL3jCr5hCZsvue5FlBBkGzl2YbfZWBz3Mf9UgnSsMdkpuwK8j/T2 cnkw== 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:arc-authentication-results; bh=bblPtIHNXnUPenyDV8Zk/g9aUcTVlSkOCqhaIvvLrzg=; b=peOY4gq97TKWPWKvh7V7IkoRk4SZffk3FrfJ0Wo5zAt9hSGTArJZMX5894hw4GmzvV Wat/H0JytbexnvLGKeufFN/wsUrpqvdwx8cjJxsB7gsrx7EZhqA6MllX/0Dam++utvki muQ+1Tlj5Yaf/tS2PUnOeKU6cKqvtmsvNYUX14ncOFq1ikngjfKr4bd2uWgeIy1UoILk K05AxLNts2P6rqUBPV2OyZTdSWkjczCJ8JXMVKgwhb8CTvpKn5toq1h8vCmr6d7j3OcL D9hbwT3jbxg5fLV4wBODJdZ2JNaX3QCNwYZ64g1U0QeXhpgZ8oCJCq3MHc11my/Jg2um HwVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 f9si5367115pgt.303.2018.02.26.02.40.14; Mon, 26 Feb 2018 02:40:29 -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; 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 S1752576AbeBZKjQ (ORCPT + 99 others); Mon, 26 Feb 2018 05:39:16 -0500 Received: from foss.arm.com ([217.140.101.70]:47950 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeBZKjP (ORCPT ); Mon, 26 Feb 2018 05:39:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2BAD71596; Mon, 26 Feb 2018 02:39:15 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F005C3F24D; Mon, 26 Feb 2018 02:39:14 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 752271AE101A; Mon, 26 Feb 2018 10:39:16 +0000 (GMT) Date: Mon, 26 Feb 2018 10:39:16 +0000 From: Will Deacon To: Daniel Lustig Cc: Peter Zijlstra , "Paul E. McKenney" , Andrea Parri , linux-kernel@vger.kernel.org, Palmer Dabbelt , Albert Ou , Alan Stern , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Ingo Molnar , Linus Torvalds , linux-riscv@lists.infradead.org Subject: Re: [RFC PATCH] riscv/locking: Strengthen spin_lock() and spin_unlock() Message-ID: <20180226103915.GA8736@arm.com> References: <1519301990-11766-1-git-send-email-parri.andrea@gmail.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563431d0-4fb5-9efd-c393-83cc5197e934@nvidia.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 11:47:57AM -0800, Daniel Lustig wrote: > On 2/22/2018 10:27 AM, Peter Zijlstra wrote: > > On Thu, Feb 22, 2018 at 10:13:17AM -0800, Paul E. McKenney wrote: > >> So we have something that is not all that rare in the Linux kernel > >> community, namely two conflicting more-or-less concurrent changes. > >> This clearly needs to be resolved, either by us not strengthening the > >> Linux-kernel memory model in the way we were planning to or by you > >> strengthening RISC-V to be no weaker than PowerPC for these sorts of > >> externally viewed release-acquire situations. > >> > >> Other thoughts? > > > > Like said in the other email, I would _much_ prefer to not go weaker > > than PPC, I find that PPC is already painfully weak at times. > > Sure, and RISC-V could make this work too by using RCsc instructions > and/or by using lightweight fences instead. It just wasn't clear at > first whether smp_load_acquire() and smp_store_release() were RCpc, > RCsc, or something else, and hence whether RISC-V would actually need > to use something stronger than pure RCpc there. Likewise for > spin_unlock()/spin_lock() and everywhere else this comes up. > > As Paul's email in the other thread observed, RCpc seems to be > OK for smp_load_acquire()/smp_store_release() at least according > to the current LKMM herd spec. Unlock/lock are stronger already > I guess. But if there's an active proposal to strengthen them all > to something stricter than pure RCpc, then that's good to know. > > My understanding from earlier discussions is that ARM has no plans > to use their own RCpc instruction for smp_load_acquire() instead > of their RCsc instructions. Is that still true? If they were to > use the RCpc load there, that would cause them to have the same > problem we're discussing here, right? Just checking. Agreed. No plans to use the LDAPR instruction in Linux. Will