Received: by 10.223.185.116 with SMTP id b49csp1740918wrg; Thu, 22 Feb 2018 02:16:45 -0800 (PST) X-Google-Smtp-Source: AH8x225OGvGlZxiHUUV4JBfbVC3ScSGStNz0vrYxKKs8YExnBgAu8cdeXajJnRaNp5RIvASZvCSQ X-Received: by 10.99.141.200 with SMTP id z191mr5186925pgd.418.1519294605202; Thu, 22 Feb 2018 02:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519294605; cv=none; d=google.com; s=arc-20160816; b=CybuGOD0hXBHQ2dJN7tYm2TjIvXKFT0yv2e2o5QwR7tKGLHJTjQhOpdxdjzTFXPuEV 9UXsEdbRXE6goecncN1JDv7hDzA09kB07Y4NoNbZFuqI9+2oFSwTgJnxp58Ieixd6tX7 CmdQZYSWkmICQJLmhdEKrDvEUAd2XQCsoZ3BfAeOL3NdVRhmiju1vBRX2+VYOcpNVhNn TXaBopoauwg5fMjbX1SlRCNygbnfj7CMewByEM0MuHDyp1ecI/4fmMhhSO1D2sR7/LOy 1XFOeu0ozhAjmtvOtNcvIREg34BEi6Cdzg903Zd3bcQrXdzl8DwPoILUgDcagwmIlhe9 7xxw== 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=BoxSJeYDwKJSoKsPdeC4ikBVlPld2Huylgk4bHT31M8=; b=B3AkdR7olCN4zHrgxFALNpfpKci9QsP7ztj92D/LysZ725kZ1axip7YsiuVoUQOD6x NmtIZaVa12W91/dBgFVSFTaeU/FKTba172P3/IcN1mi+Uo5DrfYfNf451cpppN+Fq7ft jGxEHRoSED/TDkyxl/oAU6+S3Tq3pHHbvXm5lpYZDDlBZiqG4vtt5OAONXxA7796+kg8 CAGPk/ewpHbG/cKWVk8xHYuygI+AtzYgx8nie2t222UA37Ww0zFcj9U3X6ZFhxBxSWPa nTCiBek8PmR1VBJ3TXN5DH+HW45OGby8LwC5oOFelN5hJGxRh8YdJoo/znXYJ3Np9jQ8 bTNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rtysNnoC; 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 p61-v6si1736710plb.584.2018.02.22.02.16.30; Thu, 22 Feb 2018 02:16:45 -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=merlin.20170209 header.b=rtysNnoC; 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 S1753288AbeBVKPX (ORCPT + 99 others); Thu, 22 Feb 2018 05:15:23 -0500 Received: from merlin.infradead.org ([205.233.59.134]:49192 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbeBVKPW (ORCPT ); Thu, 22 Feb 2018 05:15:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=BoxSJeYDwKJSoKsPdeC4ikBVlPld2Huylgk4bHT31M8=; b=rtysNnoCWHFjrDcHRZ3YVAP4I q+/JuWYdfh+fp8ggaPDrM66UV3sypQQLqfmx+6s2gtuXEji3W4oAupjugO8FweeYgsHUe/Qvm2LUw iuiQSk1gNiaAERfX1xMIWllyGfiiUZddTBEXsZAhPCQvKOx1cqtUOTznUPvQ7oLaFGLCPnNCumBE3 55WxHdzpPrFgE5/MgoBDPN6QhYGfPGrOOwgcQ+UBOTa5HNQkS8alZFeUW4T1EYEIrp4b5OCiLiaP8 4PW2NIvO30IWgHXyuDhYz6Wc5uWmI2SWCapZwC4FoNSuTihICruyX55aUNK4Y2TpcI1zK15mYsLiX TyfBIeunA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eonu5-0003JD-8r; Thu, 22 Feb 2018 10:15:06 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1A2042029F9FA; Thu, 22 Feb 2018 11:15:04 +0100 (CET) Date: Thu, 22 Feb 2018 11:15:04 +0100 From: Peter Zijlstra To: Boqun Feng Cc: Daniel Lustig , "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org, stern@rowland.harvard.edu, parri.andrea@gmail.com, will.deacon@arm.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, nborisov@suse.com, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: Re: [PATCH RFC tools/lkmm 10/12] tools/memory-model: Add a S lock-based external-view litmus test Message-ID: <20180222101504.GQ25201@hirez.programming.kicks-ass.net> References: <20180220232405.GA19274@linux.vnet.ibm.com> <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> <20180222032349.klcuiq23f52sfop6@tardis> <20180222041357.GB2855@linux.vnet.ibm.com> <20180222052746.vofmqbpnmfahck3z@tardis> <20180222065847.zqiquiyehvzgiiht@tardis> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222065847.zqiquiyehvzgiiht@tardis> 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 Thu, Feb 22, 2018 at 02:58:47PM +0800, Boqun Feng wrote: > > And yes, if we go with a purely RCpc interpretation of acquire and > > release, then I don't believe the writes in the previous critical > > section would be ordered with the writes in the subsequent critical > > section. That's really all the argument boils down to. We'd like > > I think atomics in Linux kernel(and in LKMM) are purely RCpc, right? > Alan and Andrea? > > And we are not going to change it, are we? > > If atomics in Linux kernel are purely RCpc, then it cerntainly makes > sense for riscv to provide purely RCpc atomics. So there's 3 things: smp_load_acquire(), smp_store_release() atomic*_{acquire,release}() *_{lock,unlock}(); Which are all quite distinct. smp_load_acquire() and smp_store_release() are RCpc, and there is no discussion of ever wanting to change that. The atomics also follow this and are RCpc, in fact the RELEASE only applies to the STORE and the ACQUIRE only applies to the LOAD of the atomics. The locking primitives OTOH we would really rather like to be RCsc, and everybody except PPC has them as such, PPC being the only one having RCpc locks. I read the part you quoted from Daniel as being purely about spinlocks, the 'critical section' wording being a dead give away, so I'm then somewhat confused why you talk about atomics.