Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1484206ybv; Fri, 14 Feb 2020 00:22:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxYcnuHdnn9Wtq/V9yIU4LVBxy9vUGLrvNcG1gF/oaitk6sfoaS7MC9lxFp6q/iUMabmn/o X-Received: by 2002:a9d:6d1a:: with SMTP id o26mr1264674otp.141.1581668527065; Fri, 14 Feb 2020 00:22:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581668527; cv=none; d=google.com; s=arc-20160816; b=zK//Na0wY/+YRTuETlk180b9SfQfzUf3XQ8EJfbm4sqOkZyNG2UC9/OHBqWKYgBOZw 70VuX5XfZqHM59mUY66Kgw37K+Ge2E3hkcQovf+zMa3sFObCAxa0M925FEEes2AXjU6b ntsJAmoVwKi6roai5200YFZyWHTPneCwo2diNmPd12Gbw/XcyOmE8QL5s67BbQ962vMS xHXO5XCflIUzZpvDxTFeQf0IQ4wSIaaIgfLFWQ3o0CFzhMfk1YYcpR226f2pbSy45s5B 9hOlvnSlmVR90US4+IExJKaRiEK+1VEex58w8p5JvFfXqUgO8vqgg8JiILLAzoVPP6VY xCUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=t/x/CDVKcjVhDvaDNlzActs6ZY2vMfwoiLIHukrUfng=; b=q66f4bCdlP7wq7Li5EBRlkgf/s+xozxCugtwbGYhZNHV2rXspZHpI9PddSiN7nug7g LMu4zoQPoZw276agAf9/JheL9RrlWWi8gJ2RQbiK7d3t6ei4HzQ4rSmrfALl15K1fxyN 1LrrZ1ij63p4jUegkfAhrjGd/quogaj9yyDCGFCpUpRO4PuoHRHJgjHlwYlw6MCBxLvr qfeR560Na5EYPIPJErYbCB+2gAraP3+4bKYalfZHoc+vyY3YFQZ8pM3NhZ6oyWy4bu1V dKfYbSA1g4eoJ6A3ySgXiZSbTql9NuYNjZJodFTV57oiLbrd8vHORYOXU6nAcZnCVlbV 1/9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UmI3ZjQn; 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 a22si2556904otp.84.2020.02.14.00.21.53; Fri, 14 Feb 2020 00:22:07 -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=UmI3ZjQn; 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 S1728582AbgBNIUs (ORCPT + 99 others); Fri, 14 Feb 2020 03:20:48 -0500 Received: from mail-qv1-f66.google.com ([209.85.219.66]:33040 "EHLO mail-qv1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbgBNIUs (ORCPT ); Fri, 14 Feb 2020 03:20:48 -0500 Received: by mail-qv1-f66.google.com with SMTP id z3so3931676qvn.0; Fri, 14 Feb 2020 00:20:47 -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; bh=t/x/CDVKcjVhDvaDNlzActs6ZY2vMfwoiLIHukrUfng=; b=UmI3ZjQniXlRn29AjFC78EzXV2zYnESaeGap8kwrctiD9G1bEzhrFDZyvwqGwIOmdD uo+qmFqu0WhfsJDkiiSXUYMSpDDzpkBKkOjtnrfRGMdRKDppbm6sDEZpFp4XQ7vbZef9 ePt2Rixd0oQSDevxEoiNEvDLV4azIg+1tcCpHmsHaVlE7nKmI7xW8r148Wip9ByQHdRe FVq1zPjrLEfCmZNcJLrY7YV++ydhOpA2b/lz72r0h6iKxc5i9+sHxceSPFe4hHDO+7gm mJfFl/SNaAlapDvm93yqF+k1gaDowh9nSYJ8B10KxxFylQBEOyeBw6gvzXJRtAr45Tdv HO5Q== 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; bh=t/x/CDVKcjVhDvaDNlzActs6ZY2vMfwoiLIHukrUfng=; b=N8p81LwEk+obqklsdjT/4D6R8aUvuclbKhLqCTHEyJuUpwXw7fTM/Lcn+YflJjddTr 7B+mrMTp/+yucrBMevVafcQQ4X361gqvo1zkmvqMdJlMOZ60SAMC2bFKehfyIC24Ck6k nAELcMsqhx2d0/MNvn3gOBuFGWzkeOkq+IEA+yPk8cM+mXC0Hf/jGcjSZSFpaKrENVgw Aegq2QdOVT3OTtuVlaB/fB1Qq3bUl18yWKEUznL4bcHT74EXgi5o7nnKpUiaqYkTFA/Z qJ1MzgnlHuoLJtvpRY7p7mhcemHeSe1GtK4ST+lqP9WStxsWYjSxGM+1dyVk6GsOqnOm +hBg== X-Gm-Message-State: APjAAAWN3Zu7748Bos/utIyYUHgeGCK/kUDdu6WBG+a14A6HHRRxZ64S rsvXO9x/eQW18riYboYnUV0= X-Received: by 2002:ad4:4e04:: with SMTP id dl4mr1114972qvb.150.1581668446967; Fri, 14 Feb 2020 00:20:46 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id o187sm2734969qkf.26.2020.02.14.00.20.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2020 00:20:46 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 91ECE22189; Fri, 14 Feb 2020 03:20:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 14 Feb 2020 03:20:45 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieelgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeeuohhquhhn ucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecukfhppeehvd drudehhedrudduuddrjedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthi dqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghi lhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id 758213280067; Fri, 14 Feb 2020 03:20:44 -0500 (EST) Date: Fri, 14 Feb 2020 16:20:42 +0800 From: Boqun Feng To: Andrea Parri Cc: linux-kernel@vger.kernel.org, Alan Stern , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [RFC 3/3] tools/memory-model: Add litmus test for RMW + smp_mb__after_atomic() Message-ID: <20200214082042.GB20408@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <20200214040132.91934-1-boqun.feng@gmail.com> <20200214040132.91934-4-boqun.feng@gmail.com> <20200214061537.GA20408@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> <20200214081826.GB17708@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214081826.GB17708@andrea> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 14, 2020 at 09:18:26AM +0100, Andrea Parri wrote: > > > @@ -0,0 +1,29 @@ > > > +C Atomic-RMW+mb__after_atomic-is-strong-acquire > > > + > > > +(* > > > + * Result: Never > > > + * > > > + * Test of an atomic RMW followed by a smp_mb__after_atomic() is > > > + * "strong-acquire": both the read and write part of the RMW is ordered before > > > + * the subsequential memory accesses. > > > + *) > > > + > > > +{ > > > +} > > > + > > > +P0(int *x, atomic_t *y) > > > +{ > > > + r0 = READ_ONCE(*x); > > > + smp_rmb(); > > > + r1 = atomic_read(y); > > IIRC, klitmus7 needs a declaration for these local variables, say > (trying to keep herd7 happy): > Got it. I will add the declaration in the next version. It's just that herd doesn't need those so I haven't put them in this version ;-) Thanks! Regards, Boqun > P0(int *x, atomic_t *y) > { > int r0; > int r1; > > r0 = READ_ONCE(*x); > smp_rmb(); > r1 = atomic_read(y); > } > > Thanks, > Andrea