Received: by 10.223.185.116 with SMTP id b49csp563524wrg; Fri, 23 Feb 2018 03:17:46 -0800 (PST) X-Google-Smtp-Source: AH8x227Mh8kRFkyJUplvW56XPPGCnCH0DQZDEgVFL6KlcWLu059bu7OTHQ2Ds1HmZiSp9q0uYLFy X-Received: by 10.99.63.9 with SMTP id m9mr1205760pga.247.1519384666464; Fri, 23 Feb 2018 03:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519384666; cv=none; d=google.com; s=arc-20160816; b=DzQpqSNDrzDkC9FLFcGFPRVb0gzrn8i1br/BF8/Ivv5fbkqJF3bojmF7heSwsGQe+g wO99EjW5u9923Z2n+9JgzWHLSMGbJOC6ZvLzwWjurDiha6FiRi7WI7SbonAihOojKQ66 3vlzzmMjLTveNWMzMMOl7gajrk88epEjVeogs7sR7BWC0OmkW03oiTo52AhlH66SITen RLR5cs2rGwFmmIMf3tww8m0l2c3eXAs19a0F/lgbwrkrM/7ZSF4cg1PSMESiLio2tdQY 0U6JbYQ03WHVJ7iSaTgwBWXC+ItojMyLO3cEz8wrLRh6MSW1eN1R6EqvgO6JLtfpNqfy gkvQ== 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=BK0QzEuTz0v69zaKKI4oqPcaahfwG9HiN6r1nVVXWKE=; b=eK7SFv4634Q1STYX64ULKz4k4RBfLZ/RF5QzGtITcxsNibCpay8zv54EpM8kk1BxF8 20CDETZ1TxrBcK3mN/4s1tQTiNtcGsWan0jFsR90mDGI4SRa/S8a00N1lBOw/HaPEaeP Y3G+7v4CYA3LBy7519sGfatYa4xzQPVfJdkeDJYqH8DRjx0+OH/J1s1IOnLCiLK/L708 kG+4sx2A/x2MudVy5boSw+0Mqg2kOBpPqFRT58or3p4/1NSCmQNnw1lHDcbT/GmP0bS7 Olg1LbzcqcHNgMNlPbzJmS5/Lk8yACu1e0V9z1kapNd7DHh2dAgmt8dQEAoGSp11deDg pldg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XM5o3cLB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k18si1341545pgt.786.2018.02.23.03.17.31; Fri, 23 Feb 2018 03:17:46 -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=pass header.i=@gmail.com header.s=20161025 header.b=XM5o3cLB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751692AbeBWLQN (ORCPT + 99 others); Fri, 23 Feb 2018 06:16:13 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:51981 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbeBWLQL (ORCPT ); Fri, 23 Feb 2018 06:16:11 -0500 Received: by mail-wm0-f66.google.com with SMTP id h21so3979279wmd.1 for ; Fri, 23 Feb 2018 03:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BK0QzEuTz0v69zaKKI4oqPcaahfwG9HiN6r1nVVXWKE=; b=XM5o3cLBDxHo/P1kjo8aX7EatMAvy6nN1Jy7rOxwBXxoE6ljXix5snqA/kFCUOtBIM dPdohxzBeEnhIDvCH9Ke9UKWcdXnKsEx/0//EKPEEjCGCWWcinOU2o/47ProbgG4ndQq A/w4yckBB2o2Zyvo70i3y6YOT33ZNkVwLvrRURonv98PYFmX7qFoXIt3lXp1CFcWGHzT vG3yS3xQ7kdjEUVVIP8tVaa2dmuCoj4oBMNSAliyZEFD8ZrMS5NlFuLH/9/+GdNzCy19 gttetRXWEI/ZU4i4B9cvNaGnDDt9cBE6YlJnckSf0WhHxx4UC6dgwOUi/wzMVZpSh7NS oLwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BK0QzEuTz0v69zaKKI4oqPcaahfwG9HiN6r1nVVXWKE=; b=JYCpwP62TTTZJ5mQv35dYYiYs6tAthTpt2WppB0ykvZ7/AMX0ruIIIqcoZeXmj7WMa CTlLbh5DHM/oOvE8JlvpooC3/8fih8KV3Nh+MTQhVPoz624WxNcsutKSsAJgkcOZXN8y vlvRFoU8KklSj/YjDaIX7HbmULb3l+WGf77qpI+cN9Mbu8XA8wH9TBXo8O3qIm9luBFB qQxW9tn6I1WpG2R8A+5CoSU6WMeMOxMCUFBbgPHk4tHZbCS0fc+2thiLlotpMdh+RdIs C1r7BGv6WfIDFaWf+XWryTbv64DGWGqFbVHTNip/48ZSI6xPJDCIwGPRrxFxxt0pl8wL nhiw== X-Gm-Message-State: APf1xPArDnnhvEK5/lB1uRtpm7MpF91p5HaEfaOch+EO4l3TKQBKqCKM vG88omrWRjjjDodpuMCGUfA= X-Received: by 10.28.93.80 with SMTP id r77mr1295254wmb.73.1519384570531; Fri, 23 Feb 2018 03:16:10 -0800 (PST) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id x107sm1902745wrb.97.2018.02.23.03.16.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 03:16:09 -0800 (PST) Date: Fri, 23 Feb 2018 12:16:01 +0100 From: Andrea Parri To: Daniel Lustig Cc: Peter Zijlstra , "Paul E. McKenney" , linux-kernel@vger.kernel.org, Palmer Dabbelt , Albert Ou , Alan Stern , Will Deacon , 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: <20180223111601.GA449@andrea> 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.24 (2015-08-30) 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. Thank you for the confirmations. The hope was indeed that this thread helped clarify what the (current) LKMM "expectations" are, and how these are likely to evolve in a near future. And Yes, I'm definitely with you and Paul on "let us (try to) keep LKMM and RISC-V synchronized"! ;-) Andrea > > > Dan