All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kernel-team@meta.com, mingo@kernel.org, parri.andrea@gmail.com,
	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
Subject: Re: Current LKMM patch disposition
Date: Sun, 5 Feb 2023 14:10:29 +0000	[thread overview]
Message-ID: <Y9+41ctA54pjm/KG@google.com> (raw)
In-Reply-To: <20230204222411.GC2948950@paulmck-ThinkPad-P17-Gen-1>

On Sat, Feb 04, 2023 at 02:24:11PM -0800, Paul E. McKenney wrote:
> On Sat, Feb 04, 2023 at 09:58:12AM -0500, Alan Stern wrote:
> > On Fri, Feb 03, 2023 at 05:49:41PM -0800, Paul E. McKenney wrote:
> > > On Fri, Feb 03, 2023 at 08:28:35PM -0500, Alan Stern wrote:
> > > > On Fri, Feb 03, 2023 at 04:48:43PM -0800, Paul E. McKenney wrote:
> > > > > Hello!
> > > > > 
> > > > > Here is what I currently have for LKMM patches:
> > > > > 
> > > > > 289e1c89217d4 ("locking/memory-barriers.txt: Improve documentation for writel() example")
> > > > > ebd50e2947de9 ("tools: memory-model: Add rmw-sequences to the LKMM")
> > > > > aae0c8a50d6d3 ("Documentation: Fixed a typo in atomic_t.txt")
> > > > > 9ba7d3b3b826e ("tools: memory-model: Make plain accesses carry dependencies")
> > > > > 
> > > > > 	Queued for the upcoming (v6.3) merge window.
> > > > > 
> > > > > c7637e2a8a27 ("tools/memory-model: Update some warning labels")
> > > > > 7862199d4df2 ("tools/memory-model: Unify UNLOCK+LOCK pairings to po-unlock-lock-")
> > > > > 
> > > > > 	Are ready for the next (v6.4) merge window.  If there is some
> > > > > 	reason that they should instead go into v6.3, please let us
> > > > > 	all know.
> > > > > 
> > > > > a6cd5214b5ba ("tools/memory-model: Document LKMM test procedure")
> > > > > 
> > > > > 	This goes onto the lkmm-dev pile because it is documenting how
> > > > > 	to use those scripts.
> > > > > 
> > > > > https://lore.kernel.org/lkml/Y9GPVnK6lQbY6vCK@rowland.harvard.edu/
> > > > > https://lore.kernel.org/lkml/20230126134604.2160-3-jonas.oberhauser@huaweicloud.com
> > > > > https://lore.kernel.org/lkml/20230203201913.2555494-1-joel@joelfernandes.org/
> > > > > 5d871b280e7f ("tools/memory-model: Add smp_mb__after_srcu_read_unlock()")
> > > > > 
> > > > > 	These need review and perhaps further adjustment.
> > > > > 
> > > > > So, am I missing any?  Are there any that need to be redirected?
> > > > 
> > > > The "Provide exact semantics for SRCU" patch should have:
> > > > 
> > > > 	Portions suggested by Boqun Feng and Jonas Oberhauser.
> > > > 
> > > > added at the end, together with your Reported-by: tag.  With that, I 
> > > > think it can be queued for 6.4.
> > > 
> > > Thank you!  Does the patch shown below work for you?
> > > 
> > > (I have tentatively queued this, but can easily adjust or replace it.)
> > 
> > It looks fine.
> 
> Very good, thank you for looking it over!  I pushed it out on branch
> stern.2023.02.04a.
> 
> Would anyone like to ack/review/whatever this one?

Would it be possible to add comments, something like the following? Apologies
if it is missing some ideas. I will try to improve it later.

thanks!

 - Joel

---8<-----------------------

diff --git a/tools/memory-model/linux-kernel.bell b/tools/memory-model/linux-kernel.bell
index ce068700939c..0a16177339bc 100644
--- a/tools/memory-model/linux-kernel.bell
+++ b/tools/memory-model/linux-kernel.bell
@@ -57,7 +57,23 @@ let rcu-rscs = let rec
 flag ~empty Rcu-lock \ domain(rcu-rscs) as unmatched-rcu-lock
 flag ~empty Rcu-unlock \ range(rcu-rscs) as unmatched-rcu-unlock
 
+(***************************************************************)
 (* Compute matching pairs of nested Srcu-lock and Srcu-unlock *)
+(***************************************************************)
+(*
+ * carry-srcu-data: To handle the case of the SRCU critical section split
+ * across CPUs, where the idx is used to communicate the SRCU index across CPUs
+ * (say CPU0 and CPU1), data is between the R[srcu-lock] to W[once][idx] on
+ * CPU0, which is sequenced with the ->rf is between the W[once][idx] and the
+ * R[once][idx] on CPU1.  The carry-srcu-data is made to exclude Srcu-unlock
+ * events to prevent capturing accesses across back-to-back SRCU read-side
+ * critical sections.
+ *
+ * srcu-rscs: Putting everything together, the carry-srcu-data is sequenced with
+ * a data relation, which is the data dependency between R[once][idx] on CPU1
+ * and the srcu-unlock store, and loc ensures the relation is unique for a
+ * specific lock.
+ *)
 let carry-srcu-data = (data ; [~ Srcu-unlock] ; rf)*
 let srcu-rscs = ([Srcu-lock] ; carry-srcu-data ; data ; [Srcu-unlock]) & loc
 

  reply	other threads:[~2023-02-05 14:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04  0:48 Current LKMM patch disposition Paul E. McKenney
2023-02-04  1:28 ` Alan Stern
2023-02-04  1:49   ` Paul E. McKenney
2023-02-04 14:58     ` Alan Stern
2023-02-04 22:24       ` Paul E. McKenney
2023-02-05 14:10         ` Joel Fernandes [this message]
2023-02-06 18:39           ` Alan Stern
2023-02-06 21:22             ` Joel Fernandes
2023-02-11 15:49               ` Joel Fernandes
2023-02-11 16:34                 ` Alan Stern
2023-02-11 17:18             ` Joel Fernandes
2023-02-11 20:19               ` Alan Stern
2023-02-12  0:30                 ` Joel Fernandes
2023-02-12  2:59                   ` Alan Stern
2023-02-12  3:35                     ` Joel Fernandes
2023-02-13  0:54                     ` Joel Fernandes
2023-02-13 11:15                       ` Andrea Parri
2023-02-14  0:52                         ` Joel Fernandes
2023-02-13 16:48                       ` Alan Stern
2023-02-14  0:36                         ` Joel Fernandes
2023-02-14  1:57                           ` Alan Stern
2023-02-14  2:12                             ` Joel Fernandes
2023-02-18  6:13                     ` Joel Fernandes
2023-02-18 19:21                       ` Paul E. McKenney
2023-02-19  3:20                         ` Joel Fernandes
2023-02-19  8:09                           ` Paul E. McKenney
2023-02-19  2:05                       ` Andrea Parri
2023-02-19  2:58                         ` Joel Fernandes
2023-02-06 20:18     ` Jonas Oberhauser
2023-02-06 21:23       ` Paul E. McKenney
2023-02-06 20:20 ` Jonas Oberhauser
2023-02-06 21:29   ` 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=Y9+41ctA54pjm/KG@google.com \
    --to=joel@joelfernandes.org \
    --cc=akiyks@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=j.alglave@ucl.ac.uk \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.