From: Boqun Feng <boqun.feng@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-kernel@vger.kernel.org,
Andrea Parri <parri.andrea@gmail.com>,
Will Deacon <will@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Nicholas Piggin <npiggin@gmail.com>,
David Howells <dhowells@redhat.com>,
Jade Alglave <j.alglave@ucl.ac.uk>,
Luc Maranget <luc.maranget@inria.fr>,
"Paul E. McKenney" <paulmck@kernel.org>,
Akira Yokosawa <akiyks@gmail.com>,
Daniel Lustig <dlustig@nvidia.com>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Rob Herring <robh@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-arch@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 2/5] Documentation/locking/atomic: Fix atomic-set litmus test
Date: Fri, 28 Feb 2020 14:30:24 +0800 [thread overview]
Message-ID: <20200228063024.GU69864@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.2002271133300.1730-100000@iolanthe.rowland.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 <boqun.feng@gmail.com>
>
> 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);
> > }
> >
>
>
next prev parent reply other threads:[~2020-02-28 6:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 0:40 [PATCH v3 0/5] Documentation/locking/atomic: Add litmus tests for atomic APIs Boqun Feng
2020-02-27 0:40 ` [PATCH v3 1/5] tools/memory-model: Add an exception for limitations on _unless() family Boqun Feng
2020-02-27 16:32 ` Alan Stern
2020-02-27 16:49 ` Luc Maranget
2020-02-27 18:16 ` Alan Stern
2020-02-27 17:52 ` Andrea Parri
2020-02-27 0:40 ` [PATCH v3 2/5] Documentation/locking/atomic: Fix atomic-set litmus test Boqun Feng
2020-02-27 16:34 ` Alan Stern
2020-02-28 6:30 ` Boqun Feng [this message]
2020-02-27 0:40 ` [PATCH v3 3/5] Documentation/locking/atomic: Introduce atomic-tests directory Boqun Feng
2020-02-27 16:36 ` Alan Stern
2020-02-27 0:40 ` [PATCH v3 4/5] Documentation/locking/atomic: Add a litmus test for atomic_set() Boqun Feng
2020-02-27 16:37 ` Alan Stern
2020-02-27 17:43 ` Andrea Parri
2020-02-27 0:40 ` [PATCH v3 5/5] Documentation/locking/atomic: Add a litmus test smp_mb__after_atomic() Boqun Feng
2020-02-27 16:38 ` Alan Stern
2020-02-27 15:47 ` [PATCH v3 0/5] Documentation/locking/atomic: Add litmus tests for atomic APIs Paul E. McKenney
2020-02-27 17:54 ` Andrea Parri
2020-02-28 6:12 ` Boqun Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200228063024.GU69864@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net \
--to=boqun.feng@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akiyks@gmail.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dlustig@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=j.alglave@ucl.ac.uk \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.maranget@inria.fr \
--cc=mchehab+samsung@kernel.org \
--cc=npiggin@gmail.com \
--cc=parri.andrea@gmail.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).