linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	kernel-team@meta.com, mingo@kernel.org, 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: Mon, 13 Feb 2023 12:15:31 +0100	[thread overview]
Message-ID: <Y+ob0xFUp+d7LROE@andrea> (raw)
In-Reply-To: <CAEXW_YQUOgYxYUNkQ9W6PS-JPwPSOFU5B=COV7Vf+qNF1jFC7g@mail.gmail.com>

> > Would you like to post a few examples showing some of the most difficult
> > points you encountered?  Maybe explanation.txt can be improved.
> 
> Just to list 2 of the pain points:
> 
> 1. I think it is hard to reason this section
> "PROPAGATION ORDER RELATION: cumul-fence"
> 
> All store-related fences should affect propagation order, even the
> smp_wmb() which is not A-cumulative should do so (po-earlier stores
> appearing before po-later). I think expanding this section with some
> examples would make sense to understand what makes "cumul-fence"
> different from any other store-related fence.

FWIW, litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus illustrates
the concept of A-cumulativity.  (The terminology is not LKMM-specific, it was
borrowed from other MCM literature, e.g. "Understanding POWER Multiprocessors"
in Documentation/references.txt.)


> 2. This part is confusing and has always confused me " The
> happens-before relation (hb) links memory accesses that have to
> execute in a certain order"
> 
> It is not memory accesses that execute, it is instructions that
> execute. Can we separate out "memory access" from "instruction
> execution" in this description?
> 
> I think ->hb tries to say that A ->hb B means, memory access A
> happened before memory access B exactly in its associated
> instruction's execution order (time order), but to be specific --
> should that be instruction issue order, or instruction retiring order?
> 
> AFAICS ->hb maps instruction execution order to memory access order.
> Not all ->po does  fall into that category because of out-of-order
> hardware execution. As does not ->co because the memory subsystem may
> have writes to the same variable to be resolved out of order. It would
> be nice to call out that ->po is instruction issue order, which is
> different from execution/retiring and that's why it cannot be ->hb.
> 
> ->rf does because of data flow causality, ->ppo does because of
> program structure, so that makes sense to be ->hb.
> 
> IMHO, ->rfi should as well, because it is embodying a flow of data, so
> that is a bit confusing. It would be great to clarify more perhaps
> with an example about why ->rfi cannot be ->hb, in the
> "happens-before" section.
> 
> That's really how far I typically get (line 1368) before life takes
> over, and I have to go do other survival-related things. Then I
> restart the activity. Now that I started reading the CAT file as well,
> I feel I can make it past that line :D. But I never wanted to get past
> it, till I built a solid understanding of the contents before it.
> 
> As I read the file more, I can give more feedback, but the above are
> different 2 that persist.

AFAICT, sections "The happens-before relation: hb" and "An operational model"
in Documentation/explanation.txt elaborate (should help) clarify such issues.
About the ->rfi example cf. e.g. Test PPOCA in the above mentioned paper; the
test remains allowed in arm64 and riscv.

  Andrea

  reply	other threads:[~2023-02-13 11:16 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
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 [this message]
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=Y+ob0xFUp+d7LROE@andrea \
    --to=parri.andrea@gmail.com \
    --cc=akiyks@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=j.alglave@ucl.ac.uk \
    --cc=joel@joelfernandes.org \
    --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=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 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).