mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lustig <dlustig@nvidia.com>
To: Alan Stern <stern@rowland.harvard.edu>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Andrea Parri <parri.andrea@gmail.com>,
	Luc Maranget <luc.maranget@inria.fr>,
	Jade Alglave <j.alglave@ucl.ac.uk>,
	Boqun Feng <boqun.feng@gmail.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Will Deacon <will.deacon@arm.com>,
	David Howells <dhowells@redhat.com>,
	Palmer Dabbelt <palmer@dabbelt.com>
Cc: Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Unlock-lock questions and the Linux Kernel Memory Model
Date: Mon, 27 Nov 2017 15:28:03 -0800	[thread overview]
Message-ID: <b7e2cae8-f752-b40a-bce0-80c8f6b65d3c@nvidia.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1711271553490.1424-100000@iolanthe.rowland.org>

On 11/27/2017 1:16 PM, Alan Stern wrote:> C rel-acq-write-ordering-3
> 
> {}
> 
> P0(int *x, int *s, int *y)
> {
> 	WRITE_ONCE(*x, 1);
> 	smp_store_release(s, 1);
> 	r1 = smp_load_acquire(s);
> 	WRITE_ONCE(*y, 1);
> }
> 
> P1(int *x, int *y)
> {
> 	r2 = READ_ONCE(*y);
> 	smp_rmb();
> 	r3 = READ_ONCE(*x);
> }
> 
> exists (1:r2=1 /\ 1:r3=0)
> 
<snip>
> 
> And going to extremes...

Sorry if I'm missing something obvious, but before going to extremes...
what about this one?

"SB+rel-acq" (or please rename if you have a different scheme)

{}

P0(int *x, int *s, int *y)
{
	WRITE_ONCE(*x, 1);
	smp_store_release(s, 1);
	r1 = smp_load_acquire(s);
	r2 = READ_ONCE(*y);
}

P1(int *x, int *y)
{
	WRITE_ONCE(*y, 1);
	smp_store_release(s, 2);
	r3 = smp_load_acquire(s);
	r4 = READ_ONCE(*x);
}

exists (1:r2=0 /\ 1:r4=0)

If smp_store_release() and smp_load_acquire() map to normal TSO loads
and stores on x86, then this test can't be forbidden, can it?

Similar question for the other tests, but this is probably the
easiest one to analyze.

Dan

  reply	other threads:[~2017-11-27 23:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4118cdbe-c396-08b9-a3e3-a0a6491b82fa@nvidia.com>
2017-11-27 21:16 ` Alan Stern
2017-11-27 23:28   ` Daniel Lustig [this message]
2017-11-28  9:44     ` Peter Zijlstra
2017-11-28  9:58   ` Peter Zijlstra
2017-11-29 19:04   ` Daniel Lustig
2017-11-29 19:33     ` Paul E. McKenney
2017-11-29 19:44     ` Alan Stern
2017-11-30  8:55       ` Boqun Feng
2017-11-30  9:15         ` Peter Zijlstra
2017-11-30 15:46         ` Alan Stern
2017-12-01  2:46           ` Boqun Feng
2017-12-01 15:32             ` Alan Stern
2017-12-01 16:17               ` Daniel Lustig
2017-12-01 16:24                 ` Will Deacon
2017-12-01 17:18                 ` Alan Stern
2017-11-29 19:46     ` Peter Zijlstra
2017-11-29 19:53       ` Alan Stern
2017-11-29 20:42         ` Paul E. McKenney
2017-11-29 22:18           ` Daniel Lustig
2017-11-29 22:59             ` Paul E. McKenney
2017-11-30 15:20             ` Alan Stern
2017-11-30 16:14               ` Paul E. McKenney
2017-11-30 16:25                 ` Peter Zijlstra
2017-11-30 16:39                   ` Paul E. McKenney
2017-11-30 16:41                 ` Will Deacon
2017-11-30 16:54                   ` Paul E. McKenney
2017-11-30 17:04                     ` Will Deacon
2017-11-30 17:56                     ` Alan Stern
2017-11-30 10:02       ` Will Deacon
2017-11-29 19:58     ` Peter Zijlstra

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=b7e2cae8-f752-b40a-bce0-80c8f6b65d3c@nvidia.com \
    --to=dlustig@nvidia.com \
    --cc=boqun.feng@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=j.alglave@ucl.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.maranget@inria.fr \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@linux.vnet.ibm.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

all inboxes | Powered by JetHome®