linux-toolchains.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Paul Heidekrüger" <Paul.Heidekrueger@in.tum.de>,
	clang-built-linux <llvm@lists.linux.dev>,
	linux-toolchains@vger.kernel.org,
	"Andrea Parri" <parri.andrea@gmail.com>,
	"Will Deacon" <will@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"David Howells" <dhowells@redhat.com>,
	"Jade Alglave" <j.alglave@ucl.ac.uk>,
	"Luc Maranget" <luc.maranget@inria.fr>,
	"Akira Yokosawa" <akiyks@gmail.com>,
	"Daniel Lustig" <dlustig@nvidia.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Tom Rix" <trix@redhat.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	"Marco Elver" <elver@google.com>,
	"Charalampos Mainas" <charalampos.mainas@gmail.com>,
	"Pramod Bhatotia" <pramod.bhatotia@in.tum.de>,
	"Soham Chakraborty" <s.s.chakraborty@tudelft.nl>,
	"Martin Fink" <martin.fink@in.tum.de>
Subject: Re: [PATCH RFC] tools/memory-model: Adjust ctrl dependency definition
Date: Fri, 15 Jul 2022 08:21:45 -0700	[thread overview]
Message-ID: <20220715152145.GZ1790663@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <YtFrPoOARrL/etBu@rowland.harvard.edu>

On Fri, Jul 15, 2022 at 09:27:26AM -0400, Alan Stern wrote:
> On Fri, Jul 15, 2022 at 02:27:28PM +0200, Paul Heidekrüger wrote:
> > I have just been thinking about how to word this patch; am I correct in
> > assuming that the LKMM does not deal with loop conditions? Or in other
> > words, there is no way for a loop condition to impose a ctrl dependency on
> > any WRITE_ONCE's in the loop body? It are only if and switch statements the
> > LKMM is concerned with in the case of ctrl dependencies?
> 
> In theory, the LKMM does say that a loop condition imposes a control 
> dependency on any memory accesses within the loop body.  However, the 
> herd7 tool has only very limited support for looping constructs, so in 
> practice it's not possible to create suitable litmus tests with loops.

And Alan isn't joking.  The closest simulation that I know of is to
combine limited loop unrolling with the "filter" clause.  The point of
the filter clause is to eliminate from consideration executions that
need the more iterations of the loop to be unrolled.

And that means that as far as LKMM is concerned, loop-based control
dependencies are similar to those for nested "if" statements.

							Thanx, Paul

  reply	other threads:[~2022-07-15 15:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 11:43 [PATCH RFC] tools/memory-model: Adjust ctrl dependency definition Paul Heidekrüger
2022-06-15 14:16 ` Alan Stern
2022-06-21 11:59   ` Paul Heidekrüger
2022-06-21 14:24     ` Alan Stern
2022-06-27  9:47       ` Paul Heidekrüger
2022-06-27 14:56         ` Alan Stern
2022-07-15 12:27           ` Paul Heidekrüger
2022-07-15 13:27             ` Alan Stern
2022-07-15 15:21               ` Paul E. McKenney [this message]
2022-07-18  8:24                 ` Paul Heidekrüger

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=20220715152145.GZ1790663@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=Paul.Heidekrueger@in.tum.de \
    --cc=akiyks@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=charalampos.mainas@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dlustig@nvidia.com \
    --cc=elver@google.com \
    --cc=j.alglave@ucl.ac.uk \
    --cc=joel@joelfernandes.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=luc.maranget@inria.fr \
    --cc=martin.fink@in.tum.de \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=parri.andrea@gmail.com \
    --cc=peterz@infradead.org \
    --cc=pramod.bhatotia@in.tum.de \
    --cc=s.s.chakraborty@tudelft.nl \
    --cc=stern@rowland.harvard.edu \
    --cc=trix@redhat.com \
    --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).