Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1481874ybv; Fri, 14 Feb 2020 00:19:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzEaUN3TPFrv4JPOz2lgBbfs3ihJFNUKUS0x+fCvodtWj1z/Yd6W4445ymJPFB0+D5d4PDe X-Received: by 2002:a9d:6d1a:: with SMTP id o26mr1257094otp.141.1581668346073; Fri, 14 Feb 2020 00:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581668346; cv=none; d=google.com; s=arc-20160816; b=s9DbCHcRXFwWytyz4zYs2l1/08DYGfVgJRpgJqZiG1ZLhZuBoKWDmZjl8+eVXfgvzo NC4JM40I4RKY4j7Y5A8OLONHlzGwdb24+FkM8rE1Sa+TEB9NBOlVA9VtpM2dXKbgDNnS aKqkAayO/nMScugFwSOt6jdju2waZsEgogwx7hoEZnHbpbbuhr1ANqoOu1IX7rdXAyWe BZS5O8qb5wDRWDSjdfK+xWN/T8yypW5gpVoUTDCamXG/iDka3LnwbsfSKuP4+8MK+tWU HubextG4T6NG2lQMacn1nSCYym5yJv81RxzyOyfF62Xr9w25LAv8SEfdY+mtOsePRVay o3dg== 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; bh=vSXazn/0l3CmxT7zcelHW+dDQ5NLtkBXf9Ciiz1D/AA=; b=XSQZIC5RvWOz4tD6EpVI6ij1QjDW3RAVN/Nxjk/MLMVEcL3nr8/mTqJa4ima0uQu8Q ABx5M06FJEy6Kh2ftOA764SmZH3e7anRhW7gT3ZlzbqFNIl57iHUyWF/OyASjgXV+YVJ j3WCGHqo4NywwUJ418uRH/3o0YpBJ02iMg7Qdz405pkWu/xlKUXkNhIRkmLf0bTusOwe L5kSSXhiNws3/IRXAqXsuhPqbYkMq+yKMpPo2fr5ZR4/47SpffQMdTIlysI5DLs4eQIu fvx1D3DmfeMsXlO6EF7j+kRWnhDt3tUxBNs9PDQqm6yssMBeezwQP0V/uIpCdzMBqzQt bvbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cwpWqXTX; 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.18.53; Fri, 14 Feb 2020 00:19:06 -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=cwpWqXTX; 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 S1729014AbgBNISd (ORCPT + 99 others); Fri, 14 Feb 2020 03:18:33 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:45297 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbgBNISc (ORCPT ); Fri, 14 Feb 2020 03:18:32 -0500 Received: by mail-wr1-f48.google.com with SMTP id g3so9819684wrs.12; Fri, 14 Feb 2020 00:18:30 -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=vSXazn/0l3CmxT7zcelHW+dDQ5NLtkBXf9Ciiz1D/AA=; b=cwpWqXTX1qjbMbz3GZURmSN1fuk1y4lrzbBeL4NCgnwdw02ObXHrJt9KQ9m2fKVXJJ h9TvTk4S0GP+8RiC/Ncgucwe/vQiWDy+ccu2Dtl3tb4FzI7aPkr87ioe7b0LiHKUT/Oi 255Ppjgs7uFa6P4CE1kfjd4lY02gVH3qU7pwejMyaBupa1lQR5nO8+9kYFpowjN+uCmd DpEXCIx4Fl4slhHEgTVNfw8MKRynkYTRnCO/2/4M13hRR9FswJyUGMauuxvZryEvOl0J 9kkTVNehOk2ri7rCBghM+ITNrD6P9k8Fen1oinplgDLdoFlh0cZOd6WlSqZxw2wzO7At Qg/g== 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=vSXazn/0l3CmxT7zcelHW+dDQ5NLtkBXf9Ciiz1D/AA=; b=O4Lu1mJM+Ve1MM1fYJvlrtJiPCUPAvjN6jr7damP0ewafrwCzlli7u+V0dxZGQn26U bmuW63zxC96/eLPBD+DtCj+cj2rkUvYHe0VF5wT/vTAFIlPrQZuIpxA63A9QCJPqtMeA VpxCKaf/phVfpTsyxegn/SlZyqDEaBfg7a5VBcSd2qLo3HceRK6eoK/ouqQlsAXym0gF P8wYZxl3/heA76D5wdkOrPvOLkWCNpgxw4PZNWJvhTY7z9ZtpZrMrhRvIFXhjqVk0Gi9 bih2ny9GYv9ZjfRTokAODDLsK6wBEICnSCCx3UloGxs1LUsHPA1rp4UMGqyKwW97J/So Y87w== X-Gm-Message-State: APjAAAVnQtkOfvZqUpZ1eDv0TPmvSRzWXe/47Ulz/W8PKu2OoBOWTzzZ oyDsyh9jzjVHGvZo2NUmTmE= X-Received: by 2002:adf:e70d:: with SMTP id c13mr2618482wrm.248.1581668309665; Fri, 14 Feb 2020 00:18:29 -0800 (PST) Received: from andrea (ip-213-220-200-127.net.upcbroadband.cz. [213.220.200.127]) by smtp.gmail.com with ESMTPSA id b11sm6311466wrx.89.2020.02.14.00.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 00:18:29 -0800 (PST) Date: Fri, 14 Feb 2020 09:18:26 +0100 From: Andrea Parri To: Boqun Feng 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: <20200214081826.GB17708@andrea> References: <20200214040132.91934-1-boqun.feng@gmail.com> <20200214040132.91934-4-boqun.feng@gmail.com> <20200214061537.GA20408@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214061537.GA20408@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > @@ -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): P0(int *x, atomic_t *y) { int r0; int r1; r0 = READ_ONCE(*x); smp_rmb(); r1 = atomic_read(y); } Thanks, Andrea