Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3611943imm; Mon, 25 Jun 2018 01:20:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIR5TY6c/pId1xc6kmvFbtbMoKFMrtxEn5vQwkkR+nWlAYO+Q6kyVXG/yBsi07JpZGZr3w6 X-Received: by 2002:a62:ba13:: with SMTP id k19-v6mr11969321pff.245.1529914829377; Mon, 25 Jun 2018 01:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529914829; cv=none; d=google.com; s=arc-20160816; b=v4/b8Rhn3idS9uD+DEr2nVm1cnIsAvK58CITlRt/1WAQNgsNvEKbHRiUzPmoH0/0u2 U1I4broy41ZN0jiy4yUo+4ZBYLfoPNF6UNdLG1K1uAylGXCEeyftT+rfKOIAHe9cwJQI GijRFF+s1irgIleV4pqVd1tGThvGJDWeimLKrqNxufm8DQXMA9GK+0cfJqto9HuFZhXO sryPSwt4/hGXFXpt9aEgalPDPgKE2nF4gCNcZrozD8ylJs61AegoYZalK83Qd05UVLYl nB7Ngcu5q6EX4HKXn1Y7aOVPUoJrL9Udc2+d5qFe7EUt281vXDpncwqhmsPERsO8Dv2f QVfg== 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=GNG260OkDXPjmyQRiH2aSXewZVLsNT3b73BSDZZ5sBY=; b=fu0ngO1EO1IlSp+FOtnPCP24dcggwstjQEgr1NDYkfP3gLFnyQw8Q+GnEnTMOGa3Jk v5sScF/244gD5PaG/AaI9SfqiDIAAvYnEoerv5XMmra1+Dm1YkYVzj2sBXEsIFdYD/FK gGEMbRJq3t4gF+zmIY6GJElfoZ+5tr+a5xi1QQ1FI6hcg8ut+4GUJ8FQ7tFQOsv1XBTF K/adS66vI+NY3XSK+13nZHeqqPXA3zdKdkqsGyzpVblECfAo8oE+oxtCnOfw1Wp2ViJy 66/evUo09SUbFetBoDrosnTAIsy/mCdkGAqDPsuqb8pT1wkX4jDlaLvCPOiNsK1hMOIj dX2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nbNEe3pF; 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 i11-v6si1973246pgs.674.2018.06.25.01.20.14; Mon, 25 Jun 2018 01:20:29 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nbNEe3pF; 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 S1753087AbeFYITb (ORCPT + 99 others); Mon, 25 Jun 2018 04:19:31 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:38764 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432AbeFYIT3 (ORCPT ); Mon, 25 Jun 2018 04:19:29 -0400 Received: by mail-wr0-f193.google.com with SMTP id e18-v6so12669334wrs.5 for ; Mon, 25 Jun 2018 01:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GNG260OkDXPjmyQRiH2aSXewZVLsNT3b73BSDZZ5sBY=; b=nbNEe3pFFAZfSWXxMWdr25y1l+Q9lpVpBZaV7BqU/1/rzlkiaNsqVfTWyc1cn+Ib+N ZRf++pTSnjqwvhBndhXdX4eM5mTfI1kaaXEHFQ2JqROqOD0ArR1UuLHHz0Q72m+OpUAV 7+/BtOyQ3hg5yKclCyBqZlKaJ+vUb/zWrAjKo= 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=GNG260OkDXPjmyQRiH2aSXewZVLsNT3b73BSDZZ5sBY=; b=afj/rcG0wgeGbnMhBreyKPNN1asrvON8sRlm8GNXMacIOH6QvXJTpYmQkQkU6lbaNK f9ZO9yP3n2tDxk9LOlRq++pPq7SduSaacjjWALRX8NHwJetppzfuKzDohJ4hbU8/8xRf LzYIMRD1lASxdX/gMlwtZPwnYCogasD8wvGyYGTr0sf8eYa5JljTnUl2rgjoKUWDfAZf YkrTSMKU0Qu+yjdPM8y7CwOlPD+rnuzkdyexs5BBWwpE7rAHkC49EIeHh6ahUgillknw lL2B+w+KBTfqWReFLHMghmG/Cg2e33B1IDMNKt+kZc5BnmjJ5+dQnZxUqF4Defk9XiKW a1oQ== X-Gm-Message-State: APt69E3sw63lsjWBSnFnxFytx/5+Wlt5eixbJ+/hNB+NiQ7c64i8QksY fm/N7vQVRiUT9hEu24B3HS5PXw== X-Received: by 2002:adf:ebc3:: with SMTP id v3-v6mr9137570wrn.33.1529914767824; Mon, 25 Jun 2018 01:19:27 -0700 (PDT) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id c10-v6sm14032311wrs.6.2018.06.25.01.19.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 01:19:27 -0700 (PDT) Date: Mon, 25 Jun 2018 10:19:20 +0200 From: Andrea Parri To: Will Deacon Cc: Alan Stern , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Kernel development list Subject: Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks Message-ID: <20180625081920.GA5619@andrea> References: <20180622080928.GB7601@arm.com> <20180622183007.GD1802@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622183007.GD1802@arm.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 Fri, Jun 22, 2018 at 07:30:08PM +0100, Will Deacon wrote: > > > I think the second example would preclude us using LDAPR for load-acquire, > I don't think it's a moot point. We want new architectures to implement > acquire/release efficiently, and it's not unlikely that they will have > acquire loads that are similar in semantics to LDAPR. This patch prevents > them from doing so, By this same argument, you should not be a "big fan" of rfi-rel-acq in ppo ;) consider, e.g., the two litmus tests below: what am I missing? Andrea C MP+fencewmbonceonce+pooncerelease-rfireleaseacquire-poacquireonce {} P0(int *x, int *y) { WRITE_ONCE(*x, 1); smp_wmb(); WRITE_ONCE(*y, 1); } P1(int *x, int *y, int *z) { r0 = READ_ONCE(*y); smp_store_release(z, 1); r1 = smp_load_acquire(z); r2 = READ_ONCE(*x); } exists (1:r0=1 /\ 1:r1=1 /\ 1:r2=0) AArch64 MP+dmb.st+popl-rfilq-poqp "DMB.STdWW Rfe PodRWPL RfiLQ PodRRQP Fre" Generator=diyone7 (version 7.49+02(dev)) Prefetch=0:x=F,0:y=W,1:y=F,1:x=T Com=Rf Fr Orig=DMB.STdWW Rfe PodRWPL RfiLQ PodRRQP Fre { 0:X1=x; 0:X3=y; 1:X1=y; 1:X3=z; 1:X6=x; } P0 | P1 ; MOV W0,#1 | LDR W0,[X1] ; STR W0,[X1] | MOV W2,#1 ; DMB ST | STLR W2,[X3] ; MOV W2,#1 | LDAPR W4,[X3] ; STR W2,[X3] | LDR W5,[X6] ; exists (1:X0=1 /\ 1:X4=1 /\ 1:X5=0)