Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1566118imm; Fri, 6 Jul 2018 02:26:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfRhC3vGwrhTVaiQwJ/f5eJz+r+p+0uKYcxDAcS3UliZ2Y9XCWWSNvf4SPMhC6tIK/AcwdS X-Received: by 2002:a65:5b8e:: with SMTP id i14-v6mr4158810pgr.242.1530869161210; Fri, 06 Jul 2018 02:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530869161; cv=none; d=google.com; s=arc-20160816; b=FmdPe1wUvuv30FnBoOky3QSfdtzxMqGa3PJz8xmV+iR1KL4kjg2EfS4ieK9eWlvRwI uE+qzT6HyADJMHKJpe4HYELEQw/pHy/VYgaWJyk66eHe77chJvpj7WWP4XY4oknMO7Lw yp/FlIjJDtB2zbxY7mntKMmDn3ktjVxqAItTdARA4jX/6ODOBNd2X10WmFDCmDP/dkYt 1FVinGNHQb9oKKyAhJjvLqwSk9MFtwpUXKTCratTF1zR8zJS/jE63HnZPSH5Wg/Y+zz/ Qb2Z9pqvo/GbVUnmWqzD6xqsfqydzGzniRgJZmxsAFo5mNDm7pQJ03zpAqFSC58ZDe2J EbjA== 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=WtA0PHYbeSIlNATnvreeWvkVeAzU4kZXygmQMldcz64=; b=VzxQ3jnkR6kfti4IPx+f4LMpno5+C3DQJlsgFMUIl1xYnBRBUQ/OeluvS0mlBaid+W m1F6rAT8iDPSaSiMfHt/kT7ghs89EAC0jWGt7lhTzK49aAPpVof3OQ2Ncg/Zs0ivSo1n /hHyvZoV2Z/iR6IbcLWa6LgipMY5kyiVS9mwM34wC/qyvIUMatcvho1eGDo0LU2+dvN0 pwGHCyo0OHlubKKTsP+0V2Wno1C6vr/yGpB5YRRD0fD0HfxU6+bFsBbutsjfIaaQERWd ispBvg5mXRBqQSrbrM2o31KOthQbvldPBtxR0vICwgrmHfuV2xEmmTADcbsZY+4Eb4I6 LUbw== 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 q185-v6si7752847pga.322.2018.07.06.02.25.46; Fri, 06 Jul 2018 02:26:01 -0700 (PDT) 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 S1753467AbeGFJYv (ORCPT + 99 others); Fri, 6 Jul 2018 05:24:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33560 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753061AbeGFJYt (ORCPT ); Fri, 6 Jul 2018 05:24:49 -0400 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 527C2ED1; Fri, 6 Jul 2018 02:24:49 -0700 (PDT) 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 245333F2EA; Fri, 6 Jul 2018 02:24:49 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 9F81C1AE3AF0; Fri, 6 Jul 2018 10:25:29 +0100 (BST) Date: Fri, 6 Jul 2018 10:25:29 +0100 From: Will Deacon To: "Paul E. McKenney" Cc: Daniel Lustig , Alan Stern , Andrea Parri , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Kernel development list Subject: Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks Message-ID: <20180706092529.GB17733@arm.com> References: <20180704121103.GB26941@arm.com> <20180705153140.GO3593@linux.vnet.ibm.com> <20180705162225.GH14470@arm.com> <20180705165602.GQ3593@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180705165602.GQ3593@linux.vnet.ibm.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, Jul 05, 2018 at 09:56:02AM -0700, Paul E. McKenney wrote: > On Thu, Jul 05, 2018 at 05:22:26PM +0100, Will Deacon wrote: > > On Thu, Jul 05, 2018 at 08:44:39AM -0700, Daniel Lustig wrote: > > > On 7/5/2018 8:31 AM, Paul E. McKenney wrote: > > > > On Thu, Jul 05, 2018 at 10:21:36AM -0400, Alan Stern wrote: > > > >> At any rate, it looks like instead of strengthening the relation, I > > > >> should write a patch that removes it entirely. I also will add new, > > > >> stronger relations for use with locking, essentially making spin_lock > > > >> and spin_unlock be RCsc. > > > > > > > > Only in the presence of smp_mb__after_unlock_lock() or > > > > smp_mb__after_spinlock(), correct? Or am I confused about RCsc? > > > > > > > > Thanx, Paul > > > > > > > > > > In terms of naming...is what you're asking for really RCsc? To me, > > > that would imply that even stores in the first critical section would > > > need to be ordered before loads in the second critical section. > > > Meaning that even x86 would need an mfence in either lock() or unlock()? > > > > I think a LOCK operation always implies an atomic RmW, which will give > > full ordering guarantees on x86. I know there have been interesting issues > > involving I/O accesses in the past, but I think that's still out of scope > > for the memory model. > > > > Peter will know. > > Agreed, x86 locked operations imply full fences, so x86 will order the > accesses in consecutive critical sections with respect to an observer > not holding the lock, even stores in earlier critical sections against > loads in later critical sections. We have been discussing tightening > LKMM to make an unlock-lock pair order everything except earlier stores > vs. later loads. (Of course, if everyone holds the lock, they will see > full ordering against both earlier and later critical sections.) > > Or are you pushing for something stronger? I (and I think Peter) would like something stronger, but we can't have nice things ;) Anyhow, that's not really related to this patch series, so sorry for mis-speaking and thanks to everybody who piled on with corrections! I got a bit arm-centric for a moment. I think Alan got the gist of it, so I'll wait to see what he posts. Will