Received: by 10.223.185.116 with SMTP id b49csp1441187wrg; Wed, 21 Feb 2018 19:22:05 -0800 (PST) X-Google-Smtp-Source: AH8x2271g6KCniAColnGdUpkqPDiuSBD2y89J0szU11JB5FljgjHkIJQ6FAA9E9e9P2nhlnP/alO X-Received: by 10.98.106.10 with SMTP id f10mr5417566pfc.222.1519269725276; Wed, 21 Feb 2018 19:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519269725; cv=none; d=google.com; s=arc-20160816; b=E0cAyDsKqTtqMFfNP5UKXhcbu3eI3UemCuwqNaudebEbZe2hoMwgwmVGuFj2H8KJc2 tUzR7rYGAdmzt+rLrcwYJ9pzDO1NoR1hshj8kkL8rYqNhnvbebfRtVVR0L+ba437C/5p Y6ZL31M9hvssRm0oNYdlmUcJeSE6rtXnnzFTa1wBT6fBk7H17nSz1vqEwpM8NWG2fZFj je+BHLgItZOGuGPNesMVsvsB0B/nAVddtwIeY/HI7LpBPmSMb9dcu+P0RYxjQR7wbezs 1U8OrrA3+YQ3D/VKqtdQVlS1wnQpvyNAHm7M5m1VN7Ty7WRzqyme8ywrhMrty1hJCSzZ VKqA== 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=hRNuHBRvPvYjNjHZAofRJx9cljc6QIXSF81IwWsKJNc=; b=Jwd09GA1nYI188sZ+meY+z5eDxIdwuA8iGUssgbDsAOElptBx4iCDqgLC9wojbVnDd TL0ny8TGSzugOsi/5sVfxJ8YMr21dLhgffabQGtWUZri79p6y1MqJOYNKCKpoo5jbZwP T/9fhCBN1upy61QXA42wbvXVcVSjKnKrhmIe/zGKh+Fz7/EL473fIYTxf8RCK+3roRTy tpdqp7Et5LVjQk7YUwavcElYXi7XfpTPBgZBWUAjLjE29VmwmY9MTFkKpa154UAmiul4 0olRx1pzw8mW7ij66LHtuY1fTdpR62/EsvZUHjO2jonVierfF1zxzG0u9L9pnIFTyZbJ ah4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tj7xe+av; 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 a3si699681pgc.455.2018.02.21.19.21.50; Wed, 21 Feb 2018 19:22:05 -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=Tj7xe+av; 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 S1752058AbeBVDUZ (ORCPT + 99 others); Wed, 21 Feb 2018 22:20:25 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:39770 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbeBVDUX (ORCPT ); Wed, 21 Feb 2018 22:20:23 -0500 Received: by mail-qk0-f193.google.com with SMTP id z197so4809602qkb.6; Wed, 21 Feb 2018 19:20:23 -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=hRNuHBRvPvYjNjHZAofRJx9cljc6QIXSF81IwWsKJNc=; b=Tj7xe+avQjMcd3EEIHS0FZH/LKKbP147fANjPl+Jmox1Xs5VSWoTj50+wI6HFMWSe0 Lt/L8Nx79M2i8U3Y9K58K4WYfMoOxvg7ZkhAPR5tcygeC5BiQSfVVjVHOW5cLPdFiI2X LFXycgU2RMql0BbpAih8srkN+QBmu+P9FncdTWcKFL/JiayDo2ASRLvRmcERlf+00yhm /XiODfYLgUOgXRz3GPsiRsNG21b2KVX/hriugXGzpMYTYTXa4QWUG0GOwAO34B7z/D0l Ox03JOa1HmVHZYOj5AWprpNSSr4jIJnJTGHme5g4VNwtUdAHHdqI/J960RiqiQade8+Q tQJA== 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=hRNuHBRvPvYjNjHZAofRJx9cljc6QIXSF81IwWsKJNc=; b=uY6R/gwuf5ufM8GycBBjdwRPwnAD0ZJSW3XMeaj/77NwuCORthaSAD+31BPBIw6J5Q iJER88U3BWDw7lcbLxRsYVYswVQlFFtX97AcUjJdhYYL/oWcTt+HuFq6AfegbAm7QIOd hELBm1Ojo8bA3WRA2pWb2TXkMH1lrX3uM67/EBfMIAQ2eWOakcnyOld2ZcNm8gJFhyXJ 8jhzsF4sX7YtBoOK+d7QNGBUTX9hShxDuz4ka3xoCxoQ/h/ZZis71rZRkesdDzjJXq8s +Pvzti/UNaVa03MYzSoVV0PKJ7NZ7nipt8L8/qN7tv9/uuwjAiF9PqgZ4Mj1K2WmwfQF WvCg== X-Gm-Message-State: APf1xPChjGPKhoS+TnKORmjO5TJq5mfe/FSHD4EXEC7mpN37LMKnn1l3 n4xedWdDvllmsU64Rw5wXTg= X-Received: by 10.233.220.6 with SMTP id q6mr8985572qkf.157.1519269622921; Wed, 21 Feb 2018 19:20:22 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id q2sm14042674qtf.52.2018.02.21.19.20.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 19:20:21 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id D9A5620ED1; Wed, 21 Feb 2018 22:20:20 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Wed, 21 Feb 2018 22:20:20 -0500 X-ME-Sender: Received: from localhost (unknown [45.32.128.109]) by mail.messagingengine.com (Postfix) with ESMTPA id 524CB7E13E; Wed, 21 Feb 2018 22:20:20 -0500 (EST) Date: Thu, 22 Feb 2018 11:23:49 +0800 From: Boqun Feng To: "Paul E. McKenney" Cc: 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, peterz@infradead.org, 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: <20180222032349.klcuiq23f52sfop6@tardis> References: <20180220232405.GA19274@linux.vnet.ibm.com> <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="moha4cwfm6mgy6fw" Content-Disposition: inline In-Reply-To: <1519169112-20593-10-git-send-email-paulmck@linux.vnet.ibm.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --moha4cwfm6mgy6fw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 20, 2018 at 03:25:10PM -0800, Paul E. McKenney wrote: > From: Alan Stern >=20 > This commit adds a litmus test in which P0() and P1() form a lock-based S > litmus test, with the addition of P2(), which observes P0()'s and P1()'s > accesses with a full memory barrier but without the lock. This litmus > test asks whether writes carried out by two different processes under the > same lock will be seen in order by a third process not holding that lock. > The answer to this question is "yes" for all architectures supporting Hmm.. it this true? Our spin_lock() is RCpc because of PowerPC, so spin_lock()+spin_unlock() pairs don't provide transitivity, and that's why we have smp_mb__after_unlock_lock(). Is there something I'm missing? Or there is an upcomming commit to switch PowerPC's lock implementation? [Cc ppc maintainers] Regards, Boqun > the Linux kernel, but is "no" according to the current version of LKMM. >=20 > A patch to LKMM is under development. >=20 > Signed-off-by: Alan Stern > Signed-off-by: Paul E. McKenney > --- > .../ISA2+pooncelock+pooncelock+pombonce.litmus | 41 ++++++++++++++++= ++++++ > 1 file changed, 41 insertions(+) > create mode 100644 tools/memory-model/litmus-tests/ISA2+pooncelock+poonc= elock+pombonce.litmus >=20 > diff --git a/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+p= ombonce.litmus b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock= +pombonce.litmus > new file mode 100644 > index 000000000000..7a39a0aaa976 > --- /dev/null > +++ b/tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce= =2Elitmus > @@ -0,0 +1,41 @@ > +C ISA2+pooncelock+pooncelock+pombonce.litmus > + > +(* > + * Result: Sometimes > + * > + * This test shows that the ordering provided by a lock-protected S > + * litmus test (P0() and P1()) are not visible to external process P2(). > + * This is likely to change soon. > + *) > + > +{} > + > +P0(int *x, int *y, spinlock_t *mylock) > +{ > + spin_lock(mylock); > + WRITE_ONCE(*x, 1); > + WRITE_ONCE(*y, 1); > + spin_unlock(mylock); > +} > + > +P1(int *y, int *z, spinlock_t *mylock) > +{ > + int r0; > + > + spin_lock(mylock); > + r0 =3D READ_ONCE(*y); > + WRITE_ONCE(*z, 1); > + spin_unlock(mylock); > +} > + > +P2(int *x, int *z) > +{ > + int r1; > + int r2; > + > + r2 =3D READ_ONCE(*z); > + smp_mb(); > + r1 =3D READ_ONCE(*x); > +} > + > +exists (1:r0=3D1 /\ 2:r2=3D1 /\ 2:r1=3D0) > --=20 > 2.5.2 >=20 --moha4cwfm6mgy6fw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlqON8AACgkQSXnow7UH +rhSrAf/efYzBmXqtbH/dZMeFgADgDdOVHAndf3gf30/zUhAMSspI4ZAgx/R+GC3 fcsOaq7YYWOEepRpBjgASgjb2pXp/J483ZDGAekeZv2/9ADFngrJCu7gtGTMVG8o vAB7hKM+A4Pkn9SwADBVKXWdb6NpevfltLh8VX8Y/brrvdk3tjWPTLC34qElku8w e+4ZGOHDorjPmkCC6U7KoukBxWvG7KqdRg4P/D5azs18CHvJI7myDcDxt9WsRyC0 u9IOTbj+QcX8/wewRYISwEFHbHA0ZVR1WcqEnmne0+IINfSyzhqyJc0V4VbWzR7d US877KQnFyAZAYoFQFDyp74qnQVYtQ== =zahK -----END PGP SIGNATURE----- --moha4cwfm6mgy6fw--