All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dan Lustig <dlustig@nvidia.com>, Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Anvin <hpa@zytor.com>,
	Andrea Parri <parri.andrea@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Vince Weaver <vincent.weaver@maine.edu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Stephane Eranian <eranian@google.com>,
	palmer@dabbelt.com, paul.walmsley@sifive.com, mpe@ellerman.id.au
Subject: Re: [PATCH] tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU
Date: Thu, 30 Sep 2021 16:46:34 -0400	[thread overview]
Message-ID: <20210930204634.GB482974@rowland.harvard.edu> (raw)
In-Reply-To: <20210930181753.GH880162@paulmck-ThinkPad-P17-Gen-1>

On Thu, Sep 30, 2021 at 11:17:53AM -0700, Paul E. McKenney wrote:
> On Thu, Sep 30, 2021 at 11:20:33AM -0400, Alan Stern wrote:
> > On Thu, Sep 30, 2021 at 09:08:23PM +0800, Boqun Feng wrote:
> > > A recent discussion[1] shows that we are in favor of strengthening the
> > > ordering of unlock + lock on the same CPU: a unlock and a po-after lock
> > > should provide the so-called RCtso ordering, that is a memory access S
> > > po-before the unlock should be ordered against a memory access R
> > > po-after the lock, unless S is a store and R is a load.
> > > 
> > > The strengthening meets programmers' expection that "sequence of two
> > > locked regions to be ordered wrt each other" (from Linus), and can
> > > reduce the mental burden when using locks. Therefore add it in LKMM.
> > > 
> > > [1]: https://lore.kernel.org/lkml/20210909185937.GA12379@rowland.harvard.edu/
> > > 
> > > Co-developed-by: Alan Stern <stern@rowland.harvard.edu>
> > > Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> > > Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> > > ---
> > > Alan,
> > > 
> > > I added the "Co-developed-by" and "Signed-off-by" tags since most of the
> > > work is done by you. Feel free to let me know if you want to change
> > > anything.
> > 
> > It looks good to me.  However, do we really want to add these litmus
> > tests to the kernel source, or would it be better to keep them with
> > the thousands of other tests in Paul's archives?
> 
> Either way works for me.  But if they are referred to from within the
> kernel, it is best to have them in the kernel source.  Which might be seen
> as a reason to minimize referring to litmus tests from the kernel.  ;-)

In this case the litmus tests are not referred to within the kernel 
source.

Alan

  reply	other threads:[~2021-09-30 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 13:08 [PATCH] tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU Boqun Feng
2021-09-30 15:20 ` Alan Stern
2021-09-30 18:17   ` Paul E. McKenney
2021-09-30 20:46     ` Alan Stern [this message]
2021-10-01  0:12       ` Boqun Feng
2021-10-01  1:30         ` Alan Stern
2021-10-01  6:03           ` Boqun Feng
2021-10-01  1:19 ` Boqun Feng
2021-10-08  5:30   ` Michael Ellerman
2021-10-08  6:54     ` Boqun Feng
2021-10-08 16:32       ` Palmer Dabbelt
2021-10-10 14:33         ` Boqun Feng

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=20210930204634.GB482974@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=boqun.feng@gmail.com \
    --cc=dlustig@nvidia.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=palmer@dabbelt.com \
    --cc=parri.andrea@gmail.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.weaver@maine.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.