Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3022834ybb; Mon, 30 Mar 2020 18:42:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtN553kDOaWayxdQnnhVCOkRTUCY2qVpEiLPBxHTS9/wOqxtmxyTP03UnpG7VbQMiQbivKD X-Received: by 2002:aca:1c02:: with SMTP id c2mr574611oic.125.1585618958140; Mon, 30 Mar 2020 18:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585618958; cv=none; d=google.com; s=arc-20160816; b=WIUSU81NRe//EOfUi/eLZI3gP+QnVw9xw+sMd2SwPG2GPVryPL6wNWYP0SSQmEWoj8 nRqLzOpUsGzc9CRBisXJ+9jTMb6qbNwDL/UEbw8ATyjuNv5kCpyFPd9u9z2lc0C3s4jj kppAdkPXlc4LJdoWBQjlsrNP2pXNPBLziKsMtEIfJ8e/mV/mmOyZBL2TiJNuAl2gvHfF xA9qduAZyNuipSbhdgjKFuAL7JexdksxhyKtT+NO+nx31FmoqHRiHsIMlEEXQxY7fSIP +bmuka+bU5R9rku1T1B+zXVsmWmoVewEpdKRUH6swUNorlFtdtkNBGQX1RVjt1KpvexV e3MA== 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=EKZAtUisNzB+elti6oItTfupGpeOM+Jg12azmI7Z6WE=; b=jLEAb3XvHDSnQ46CuP8VTgja0H2hDc6wIydpRskccwfkj42UTfBgHPzpnAaB1gkXEi u3jQry3Kibe4AUNZT1UsR0ytiWZiIb43ysD/cbuNfyAWrm+ZNNEWD0u9PyMN8ui5LSh5 8GJzJn02Ce+zK4IBw2W3eGHJLWlPag4uh+4w1ptxGkaKxMcvUIwsSGWFVJ6UkKFWX7T+ 24H06yC3AroejFYqWTGEOQLosTMsQLwcmtE6jIvqNNKJwdE57Tf522GOTWqD0HgxTg8Z AAK7Bb3Oc1Ay0MqZWa4UFINxj6ZwE38y1Zx/3Nf4vE1Z1c8JQXBYraSTD7MDNoH3tmvz p2Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l2CifpBI; 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 r17si7150408ota.32.2020.03.30.18.42.18; Mon, 30 Mar 2020 18:42:38 -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=@gmail.com header.s=20161025 header.b=l2CifpBI; 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 S1729464AbgCaBkq (ORCPT + 99 others); Mon, 30 Mar 2020 21:40:46 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40605 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729358AbgCaBkp (ORCPT ); Mon, 30 Mar 2020 21:40:45 -0400 Received: by mail-qt1-f193.google.com with SMTP id c9so17036832qtw.7; Mon, 30 Mar 2020 18:40:44 -0700 (PDT) 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=EKZAtUisNzB+elti6oItTfupGpeOM+Jg12azmI7Z6WE=; b=l2CifpBIVvo4k2KAev3wORlbRMa5Ibr+LVBJPpQJ0rAZai46OojX7Xaj9S4KNLkQTu q66THOkKIH6K+54NA6GaXlZndn9ZdijkFIMGKLlnCPfJBLj1Qa4WPO/nV+fx1qjrk2Ht nT7XBR1kLifRcJmNVuZFpq4ZgAFHLgQrABFyt/I/0x8Sy8ori+r85kfTwi96Xrqq0mgG 0pcvCIMlhgQDJt6VVRdGWtjGS1Bdx0XTg2lghp7l5nf9f5OncRVtzH387NkxyIVdxmwp 0jEmVS/oTuLC1jrtTnnC5pH1ykTtJdqJkZJ0XSRuxiELHxl3hTKbjCFwpS7DBxzY6L4N Wd1Q== 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=EKZAtUisNzB+elti6oItTfupGpeOM+Jg12azmI7Z6WE=; b=LkkNRjW9GTQBtke2JGtWYpAmEMzG3WX9GJXNoRImyJ22ALMCwjntG5KkHukiMkbeg+ LwGtFgvZhWoxKAzrk23bN+c7FeJbKQh3DQdpObJWPGqbVZhi4gaOjLxSpkLLApy4hB25 J2A7cpYumSC+SVO5/LobQsz8zWF7sx/3ta/6BRVczu8iBUJaQJxzskDZSYxY66GyYmG7 mq+KYgisHQSzi/4Wpt7OnJSI/l+1CD8hvJXKmj6GhFTt19JWnFZke2DZMBhxWd7JbVlP NraUbZLCF+RahlBCpoqA8C9msMRNxnfVibXn+6iUQOMvIAT2dKCD1Z/nSdB1nb0vNpi6 WVJA== X-Gm-Message-State: ANhLgQ3APPxBOzCBmlO7SmNHvauaDfRrbnY+gsU6lNiiyxlSnhl+KlEO 7ZqSgeKBlO/JIF4IeBTckxM= X-Received: by 2002:ac8:348f:: with SMTP id w15mr2919381qtb.219.1585618843878; Mon, 30 Mar 2020 18:40:43 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id j85sm11874791qke.20.2020.03.30.18.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2020 18:40:43 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id DF00027C0054; Mon, 30 Mar 2020 21:40:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 30 Mar 2020 21:40:41 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeiiedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeeuohhquhhn ucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuffhomhgrih hnpehkvghrnhgvlhdrohhrghdpihhnrhhirgdrfhhrnecukfhppeehvddrudehhedruddu uddrjedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedt ieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfh higihmvgdrnhgrmhgv X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E2FA306CA8E; Mon, 30 Mar 2020 21:40:38 -0400 (EDT) Date: Tue, 31 Mar 2020 09:40:37 +0800 From: Boqun Feng To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Jonathan Corbet , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v4 0/4] Documentation/litmus-tests: Add litmus tests for atomic APIs Message-ID: <20200331014037.GB59159@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <20200326024022.7566-1-boqun.feng@gmail.com> <20200327221843.GA226939@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200327221843.GA226939@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 27, 2020 at 06:18:43PM -0400, Joel Fernandes wrote: > On Thu, Mar 26, 2020 at 10:40:18AM +0800, Boqun Feng wrote: > > A recent discussion raises up the requirement for having test cases for > > atomic APIs: > > > > https://lore.kernel.org/lkml/20200213085849.GL14897@hirez.programming.kicks-ass.net/ > > > > , and since we already have a way to generate a test module from a > > litmus test with klitmus[1]. It makes sense that we add more litmus > > tests for atomic APIs. And based on the previous discussion, I create a > > new directory Documentation/atomic-tests and put these litmus tests > > here. > > > > This patchset starts the work by adding the litmus tests which are > > already used in atomic_t.txt, and also improve the atomic_t.txt to make > > it consistent with the litmus tests. > > > > Previous version: > > v1: https://lore.kernel.org/linux-doc/20200214040132.91934-1-boqun.feng@gmail.com/ > > v2: https://lore.kernel.org/lkml/20200219062627.104736-1-boqun.feng@gmail.com/ > > v3: https://lore.kernel.org/linux-doc/20200227004049.6853-1-boqun.feng@gmail.com/ > > For full series: > > Reviewed-by: Joel Fernandes (Google) > > One question I had was in the existing atomic_set() documentation, it talks > about atomic_add_unless() implementation based on locking could have issues. > It says the way to fix such cases is: > > Quote: > the typical solution is to then implement atomic_set{}() with > atomic_xchg(). > > I didn't get how using atomic_xchg() fixes it. Is the assumption there that > atomic_xchg() would be implemented using locking to avoid atomic_set() having Right, I think that's the intent of the sentence. > issues? If so, we could clarify that in the document. > Patches are welcome ;-) Regards, Boqun > thanks, > > - Joel > > > > > Changes since v3: > > > > * Merge two patches on atomic-set litmus test into one as per > > Alan. (Alan, you have acked only one of the two patches, so I > > don't add you acked-by for the combined patch). > > > > * Move the atomic litmus tests into litmus-tests/atomic to align > > with Joel's recent patches on RCU litmus tests. > > > > I think we still haven't reach to a conclusion for the difference of > > atomic_add_unless() in herdtools, and I'm currently reading the source > > code of herd to resovle this. This is just an updated version to resolve > > ealier comments and react on Joel's RCU litmus tests. > > > > Regards, > > Boqun > > > > [1]: http://diy.inria.fr/doc/litmus.html#klitmus > > > > Boqun Feng (4): > > tools/memory-model: Add an exception for limitations on _unless() > > family > > Documentation/litmus-tests: Introduce atomic directory > > Documentation/litmus-tests/atomic: Add a test for atomic_set() > > Documentation/litmus-tests/atomic: Add a test for > > smp_mb__after_atomic() > > > > Documentation/atomic_t.txt | 24 +++++++------- > > ...ter_atomic-is-stronger-than-acquire.litmus | 32 +++++++++++++++++++ > > ...c-RMW-ops-are-atomic-WRT-atomic_set.litmus | 24 ++++++++++++++ > > Documentation/litmus-tests/atomic/README | 16 ++++++++++ > > tools/memory-model/README | 10 ++++-- > > 5 files changed, 91 insertions(+), 15 deletions(-) > > create mode 100644 Documentation/litmus-tests/atomic/Atomic-RMW+mb__after_atomic-is-stronger-than-acquire.litmus > > create mode 100644 Documentation/litmus-tests/atomic/Atomic-RMW-ops-are-atomic-WRT-atomic_set.litmus > > create mode 100644 Documentation/litmus-tests/atomic/README > > > > -- > > 2.25.1 > >