From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: LKMM Maintainers -- Akira Yokosawa <akiyks@gmail.com>,
Andrea Parri <andrea.parri@amarulasolutions.com>,
Boqun Feng <boqun.feng@gmail.com>,
Daniel Lustig <dlustig@nvidia.com>,
David Howells <dhowells@redhat.com>,
Jade Alglave <j.alglave@ucl.ac.uk>,
Luc Maranget <luc.maranget@inria.fr>,
Nicholas Piggin <npiggin@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will.deacon@arm.com>,
Kernel development list <linux-kernel@vger.kernel.org>,
Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH 1/3] tools: memory-model: Prepare for data-race detection
Date: Wed, 24 Apr 2019 01:22:31 -0700 [thread overview]
Message-ID: <20190424082231.GF3923@linux.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1904221211440.1384-100000@iolanthe.rowland.org>
On Mon, Apr 22, 2019 at 12:17:45PM -0400, Alan Stern wrote:
> This patch makes some slight alterations to linux-kernel.cat in
> preparation for adding support for data-race detection to the
> Linux-Kernel Memory Model.
>
> The definitions of relations involved in Acquire, Release, and
> unlock-lock ordering are moved up earlier in the source file.
>
> The rmb relation is factored through the new R4rmb class: the
> class of reads to which rmb will apply.
>
> The definition of the fence relation is moved earlier, and it
> is split up into read- and write-fences (rmb and wmb) and all
> the others.
>
> This should not make any functional changes.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Thank you, Alan, I have queued all three onto -rcu for review and testing.
FYI, I rebased my smp_mb__{before,after}_atomic() patch on top of yours
to avoid the conflict.
Which demonstrates non-commutativity of patches. Your patches conflict
with mine, but mine does not conflict with yours. ;-)
Thanx, Paul
> ---
>
>
> tools/memory-model/linux-kernel.cat | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> Index: usb-devel/tools/memory-model/linux-kernel.cat
> ===================================================================
> --- usb-devel.orig/tools/memory-model/linux-kernel.cat
> +++ usb-devel/tools/memory-model/linux-kernel.cat
> @@ -26,8 +26,14 @@ include "lock.cat"
> (* Basic relations *)
> (*******************)
>
> +(* Release Acquire *)
> +let acq-po = [Acquire] ; po ; [M]
> +let po-rel = [M] ; po ; [Release]
> +let po-unlock-rf-lock-po = po ; [UL] ; rf ; [LKR] ; po
> +
> (* Fences *)
> -let rmb = [R \ Noreturn] ; fencerel(Rmb) ; [R \ Noreturn]
> +let R4rmb = R \ Noreturn (* Reads for which rmb works *)
> +let rmb = [R4rmb] ; fencerel(Rmb) ; [R4rmb]
> let wmb = [W] ; fencerel(Wmb) ; [W]
> let mb = ([M] ; fencerel(Mb) ; [M]) |
> ([M] ; fencerel(Before-atomic) ; [RMW] ; po? ; [M]) |
> @@ -36,13 +42,10 @@ let mb = ([M] ; fencerel(Mb) ; [M]) |
> ([M] ; po ; [UL] ; (co | po) ; [LKW] ;
> fencerel(After-unlock-lock) ; [M])
> let gp = po ; [Sync-rcu | Sync-srcu] ; po?
> -
> let strong-fence = mb | gp
>
> -(* Release Acquire *)
> -let acq-po = [Acquire] ; po ; [M]
> -let po-rel = [M] ; po ; [Release]
> -let po-unlock-rf-lock-po = po ; [UL] ; rf ; [LKR] ; po
> +let nonrw-fence = strong-fence | po-rel | acq-po
> +let fence = nonrw-fence | wmb | rmb
>
> (**********************************)
> (* Fundamental coherence ordering *)
> @@ -65,7 +68,6 @@ let rwdep = (dep | ctrl) ; [W]
> let overwrite = co | fr
> let to-w = rwdep | (overwrite & int)
> let to-r = addr | (dep ; rfi)
> -let fence = strong-fence | wmb | po-rel | rmb | acq-po
> let ppo = to-r | to-w | fence | (po-unlock-rf-lock-po & int)
>
> (* Propagation: Ordering from release operations and strong fences. *)
>
>
next prev parent reply other threads:[~2019-04-24 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 16:17 [PATCH 1/3] tools: memory-model: Prepare for data-race detection Alan Stern
2019-04-24 8:22 ` Paul E. McKenney [this message]
2019-04-24 14:24 ` Alan Stern
2019-04-24 18:31 ` 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=20190424082231.GF3923@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=akiyks@gmail.com \
--cc=andrea.parri@amarulasolutions.com \
--cc=boqun.feng@gmail.com \
--cc=dhowells@redhat.com \
--cc=dlustig@nvidia.com \
--cc=j.alglave@ucl.ac.uk \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.maranget@inria.fr \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=stern@rowland.harvard.edu \
--cc=will.deacon@arm.com \
/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