linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Andrea Parri <parri.andrea@gmail.com>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kernel-team@meta.com, mingo@kernel.org,
	stern@rowland.harvard.edu, will@kernel.org, peterz@infradead.org,
	boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com,
	j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com,
	Andrea Parri <andrea.parri@amarulasolutions.com>,
	Jonas Oberhauser <jonas.oberhauser@huawei.com>,
	"Paul E. McKenney" <paulmck@linux.ibm.com>
Subject: Re: [PATCH memory-model 7/8] tools/memory-model: Add documentation about SRCU read-side critical sections
Date: Tue, 21 Mar 2023 22:17:14 -0400	[thread overview]
Message-ID: <CAEXW_YTTFa7mC_1v-oDbFWPxHyfx58CvcCyNu+53MWNNo8d+NA@mail.gmail.com> (raw)
In-Reply-To: <ZBpcpPIq9k2mX7cw@andrea>

On Tue, Mar 21, 2023 at 9:40 PM Andrea Parri <parri.andrea@gmail.com> wrote:
>
> On Mon, Mar 20, 2023 at 06:02:45PM -0700, Paul E. McKenney wrote:
> > From: Alan Stern <stern@rowland.harvard.edu>
> >
> > Expand the discussion of SRCU and its read-side critical sections in
> > the Linux Kernel Memory Model documentation file explanation.txt.  The
> > new material discusses recent changes to the memory model made in
> > commit 6cd244c87428 ("tools/memory-model: Provide exact SRCU
> > semantics").
>
> How about squashing the diff below (adjusting subject and changelog):
>
>   Andrea
>
> diff --git a/tools/memory-model/Documentation/litmus-tests.txt b/tools/memory-model/Documentation/litmus-tests.txt
> index 26554b1c5575e..acac527328a1f 100644
> --- a/tools/memory-model/Documentation/litmus-tests.txt
> +++ b/tools/memory-model/Documentation/litmus-tests.txt
> @@ -1028,32 +1028,7 @@ Limitations of the Linux-kernel memory model (LKMM) include:
>                 additional call_rcu() process to the site of the
>                 emulated rcu-barrier().
>
> -       e.      Although sleepable RCU (SRCU) is now modeled, there
> -               are some subtle differences between its semantics and
> -               those in the Linux kernel.  For example, the kernel
> -               might interpret the following sequence as two partially
> -               overlapping SRCU read-side critical sections:
> -
> -                        1  r1 = srcu_read_lock(&my_srcu);
> -                        2  do_something_1();
> -                        3  r2 = srcu_read_lock(&my_srcu);
> -                        4  do_something_2();
> -                        5  srcu_read_unlock(&my_srcu, r1);
> -                        6  do_something_3();
> -                        7  srcu_read_unlock(&my_srcu, r2);
> -
> -               In contrast, LKMM will interpret this as a nested pair of
> -               SRCU read-side critical sections, with the outer critical
> -               section spanning lines 1-7 and the inner critical section
> -               spanning lines 3-5.
> -
> -               This difference would be more of a concern had anyone
> -               identified a reasonable use case for partially overlapping
> -               SRCU read-side critical sections.  For more information
> -               on the trickiness of such overlapping, please see:
> -               https://paulmck.livejournal.com/40593.html
> -
> -       f.      Reader-writer locking is not modeled.  It can be
> +       e.      Reader-writer locking is not modeled.  It can be
>                 emulated in litmus tests using atomic read-modify-write

Good point! And for the diff:

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>

thanks,

 - Joel


>                 operations.
>
>
>   Andrea

  reply	other threads:[~2023-03-22  2:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  1:02 [PATCH memory-model 0/8] LKMM updates for v6.4 Paul E. McKenney
2023-03-21  1:02 ` [PATCH memory-model 1/8] tools/memory-model: Update some warning labels Paul E. McKenney
2023-03-22  0:51   ` Andrea Parri
2023-03-21  1:02 ` [PATCH memory-model 2/8] tools/memory-model: Unify UNLOCK+LOCK pairings to po-unlock-lock-po Paul E. McKenney
2023-03-22  0:59   ` Andrea Parri
2023-03-22 18:06     ` Paul E. McKenney
2023-03-21  1:02 ` [PATCH memory-model 3/8] tools/memory-model: Add smp_mb__after_srcu_read_unlock() Paul E. McKenney
2023-03-21  1:02 ` [PATCH memory-model 4/8] tools/memory-model: Restrict to-r to read-read address dependency Paul E. McKenney
2023-03-22  0:53   ` Andrea Parri
2023-03-21  1:02 ` [PATCH memory-model 5/8] tools/memory-model: Provide exact SRCU semantics Paul E. McKenney
2023-03-22  1:07   ` Andrea Parri
2023-03-22  1:13     ` Alan Stern
2023-03-21  1:02 ` [PATCH memory-model 6/8] tools/memory-model: Make ppo a subrelation of po Paul E. McKenney
2023-03-21  1:02 ` [PATCH memory-model 7/8] tools/memory-model: Add documentation about SRCU read-side critical sections Paul E. McKenney
2023-03-22  1:40   ` Andrea Parri
2023-03-22  2:17     ` Joel Fernandes [this message]
2023-03-22 14:30     ` Alan Stern
2023-03-22 18:02     ` Paul E. McKenney
2023-03-21  1:02 ` [PATCH memory-model 8/8] Documentation: litmus-tests: Correct spelling Paul E. McKenney

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=CAEXW_YTTFa7mC_1v-oDbFWPxHyfx58CvcCyNu+53MWNNo8d+NA@mail.gmail.com \
    --to=joel@joelfernandes.org \
    --cc=akiyks@gmail.com \
    --cc=andrea.parri@amarulasolutions.com \
    --cc=boqun.feng@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=j.alglave@ucl.ac.uk \
    --cc=jonas.oberhauser@huawei.com \
    --cc=kernel-team@meta.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.maranget@inria.fr \
    --cc=mingo@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=paulmck@linux.ibm.com \
    --cc=peterz@infradead.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).