Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp339177ybf; Thu, 27 Feb 2020 22:30:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxgE7ZYMhSn3891e0aSthIlnT/rF8Ren37gOaqO5FFNHwZYveOnnLjfsYSacym1tirQd1vi X-Received: by 2002:a9d:740d:: with SMTP id n13mr2207200otk.140.1582871456369; Thu, 27 Feb 2020 22:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582871456; cv=none; d=google.com; s=arc-20160816; b=Unqo0oMWl3mI+KdJaY6/GKPbkmoznQxztTRLYGH2jvrbzY6pfqfJ33JNpXENRjNZf0 B0z5lB4xLHsrpZd3AoJRAGwKimravieHMo6v/266ulnKugHllUIBfAbl1zs7rcI1MZ4X ViT2qE7RRmgnvEgL9OynBJArki6GGycCZzVntGmnf6hStqa+K2OtWJMH4MHHU/ExkSBh 4FSwVowV3A4W726b33IfOJ59qjmvxyhICexo4puVpE9e/n/jnYfM7JcJsXu1aEWgNAoW i56ZZaKiL0IkqCABnh2Edndt1/3zk1WGeyoSiYDkh26ARkd6WJ4NfHicLHzjosByinxO G0dA== 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=7TS07qm5BTzPoIctEpgMyVEvZEu8e9vIDaiI4S1jRII=; b=es//mnrdUGZfz/ThQkyC/L8a9E3HPlYlNUaENduiUKDtU1FC4a5z9UazZxwoSRvJTt 2eOTKsdDEH1ACk+/hlkTnfM+s/Uy00rqPFTmbAIpySJsyor26n22SZ+pS6SKctwsafDq j/Kcu4qyF+lJEcHHgjONOZeLi0kn8sCcARMyGWIgDqdJ/nNy5HvfQwCBGycy/4X4JrBN u3+/k1XJvNHujlwT1foggke/iBj3l9Xt7Kk28G2NtZfrG3Olwy1nczYS4A+H4qqyUw1V J0khp86z++BgBC9N+10FMMjdP6FmyOhaMAG7G2Z/Z9MuPhq56Mvt6HM1McsCF+fM10Wj yEOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nZYtRjO2; 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 l6si1032722oti.249.2020.02.27.22.30.42; Thu, 27 Feb 2020 22:30:56 -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=nZYtRjO2; 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 S1726440AbgB1Gad (ORCPT + 99 others); Fri, 28 Feb 2020 01:30:33 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36430 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgB1Gad (ORCPT ); Fri, 28 Feb 2020 01:30:33 -0500 Received: by mail-qt1-f193.google.com with SMTP id t13so1297450qto.3; Thu, 27 Feb 2020 22:30:32 -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=7TS07qm5BTzPoIctEpgMyVEvZEu8e9vIDaiI4S1jRII=; b=nZYtRjO2I5BXWjnVy9qkjCyLXjT2Ji1fya8iFrWtSm7NGagYGnzGjEJpYjVg7T1sXA Vehqo1LeklXK5N9yoq0o6uoFcKXMQPMfjcyp1TMBPAkEPk0SL08w8V1V1oLUzBVC9BZo ZHYyIudKx0rfsTQ4leSYIpoxBSesP23LpTR9tbknlOGK4bVI//+2pXh64Sa8UsDo3ewR P4UCBttEUCmQhN9K0mieJP9UjRLJKGYZgEqb4/vW2JZJ1OIIR6GHxL892zDWCHiYa0Q2 uEieDhkqY2mdfq1zm3bVRn1NhtasXu7+BmZhmx1AhQeYTleA6/eorLHR0C2RRG55j12x EMoA== 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=7TS07qm5BTzPoIctEpgMyVEvZEu8e9vIDaiI4S1jRII=; b=q5vHH1UG0tiNgS5jSG4iPiWzEvjyR8Tue/5+/u10RdWGSJF5npwSv3yC3jBXHumdPq 7AKQo+Qfayy/CFVUoXEADAclSf+NLORY4CING+ZqIfyR+8VvhToUJEw4Au4uKX8UOpD1 jPlZ4RdvnYrJWYRLJRJ3gNYYXFA4Rgpe2Di3jDzu/D1iWaSeMp3ISXBoE/tRx53rgWEC LS8hF6wFabAN28mZNI5mWD7Q5uMbp4OTT6P/a5qBdk4Jtfli/oqzW2J4S3wjwQ3q+AR7 U0XjbjUFRt9ZrTfSR2BsZOAAi5Tp1ZMY/aszJh22MQlQte+Ivyo/iijnzLtW33Hs8qD3 WZ0A== X-Gm-Message-State: APjAAAW/CjxP9ijXOqCZP8ERyiyQsrX4ePfiIwjDAehIgalg9bwbJ/7m nn1wwvIAOhbXDWsyxGOOJQg= X-Received: by 2002:ac8:1a19:: with SMTP id v25mr2978785qtj.146.1582871432010; Thu, 27 Feb 2020 22:30:32 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id d74sm4563641qke.91.2020.02.27.22.30.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Feb 2020 22:30:31 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 26FD522223; Fri, 28 Feb 2020 01:30:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 28 Feb 2020 01:30:30 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleejgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucfkphephedvrd duheehrdduuddurdejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqd eiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhl rdgtohhmsehfihigmhgvrdhnrghmvg X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id DE49C3280065; Fri, 28 Feb 2020 01:30:25 -0500 (EST) Date: Fri, 28 Feb 2020 14:30:24 +0800 From: Boqun Feng To: Alan Stern Cc: linux-kernel@vger.kernel.org, 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 v3 2/5] Documentation/locking/atomic: Fix atomic-set litmus test Message-ID: <20200228063024.GU69864@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <20200227004049.6853-3-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 11:34:55AM -0500, Alan Stern wrote: > On Thu, 27 Feb 2020, Boqun Feng wrote: > > > Currently the litmus test "atomic-set" in atomic_t.txt has a few things > > to be improved: > > > > 1) The CPU/Processor numbers "P1,P2" are not only inconsistent with > > the rest of the document, which uses "CPU0" and "CPU1", but also > > unacceptable by the herd tool, which requires processors start > > at "P0". > > > > 2) The initialization block uses a "atomic_set()", which is OK, but > > it's better to use ATOMIC_INIT() to make clear this is an > > initialization. > > > > 3) The return value of atomic_add_unless() is discarded > > inexplicitly, which is OK for C language, but it will be helpful > > to the herd tool if we use a void cast to make the discard > > explicit. > > > > Therefore fix these and this is the preparation for adding the litmus > > test into memory-model litmus-tests directory so that people can > > understand better about our requirements of atomic APIs and klitmus tool > > can be used to generate tests. > > > > Signed-off-by: Boqun Feng > > Patch 5/5 in this series does basically the same thing for > Atomic-RMW+mb__after_atomic-is-stronger-than-acquire. How come you > used one patch for that, but this is split into two patches (2/5 and > 4/5)? > When I was working one the first version, I wasn't so sure that we would reach the agreement of where to put the litmus tests, and the litmus test in the atomic_t.txt obviously needs a fix, so I separated the fix and the adding of a litmus test to make my rebase easier ;-). But you're right, the separation is not needed now. I will merge those two patches into one in the next version, also with the name adjustment you and Andrea have pointed out. Thanks! Regards, Boqun > Alan > > > --- > > Documentation/atomic_t.txt | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt > > index 0ab747e0d5ac..ceb85ada378e 100644 > > --- a/Documentation/atomic_t.txt > > +++ b/Documentation/atomic_t.txt > > @@ -91,15 +91,15 @@ ops. That is: > > C atomic-set > > > > { > > - atomic_set(v, 1); > > + atomic_t v = ATOMIC_INIT(1); > > } > > > > - P1(atomic_t *v) > > + P0(atomic_t *v) > > { > > - atomic_add_unless(v, 1, 0); > > + (void)atomic_add_unless(v, 1, 0); > > } > > > > - P2(atomic_t *v) > > + P1(atomic_t *v) > > { > > atomic_set(v, 0); > > } > > > >