All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Yubin Ruan <ablacktshirt@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: different kind of memory reordering clarification
Date: Tue, 10 Apr 2018 20:02:30 -0700	[thread overview]
Message-ID: <20180411030230.GG3948@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180411024538.grp62hwvtxpapzeh@HP>

On Wed, Apr 11, 2018 at 10:46:28AM +0800, Yubin Ruan wrote:
> On Tue, Apr 10, 2018 at 10:04:09AM -0700, Paul E. McKenney wrote:
> > On Tue, Apr 10, 2018 at 11:20:24PM +0800, Yubin Ruan wrote:
> > > On Tue, Apr 10, 2018 at 08:14:08PM +0800, Yubin Ruan wrote:
> [...]
> > > > 
> > > > Can you please provide me with some examples or references for different kinds
> > > > of memory reordering in a SMP system? You know, there are different kinds of
> > > > reordering:
> > > > 
> > > >    - Loads reordered after loads
> > > >    - Loads reordered after stores
> > > >    - Stores reordered after stores
> > > >    - Stores reordered after loads
> > > >    - Atomic reordered with loads
> > > >    - Atomic reordered with stores
> > > >    - Dependent loads reordered (DEC alpha)
> > > 
> > > I remember there is open-std.org webpage containing comparision of C++'s
> > > memory model to those primitives used in the Linux kernel. But I just can't
> > > find that page.
> > 
> > Here you go!
> > 
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0124r4.html
> > 
> > There will be an update in a month or so, but the above is pretty
> > close.  Also, the Linux-kernel memory model was presented at
> > ASPLOS and accepted into the Linux kernel itself:
> > 
> > https://paulmck.livejournal.com/49667.html
> 
> Many thanks. But I am currently confused about the relationship between
> terminologies used in the Linux kernel and those used in some programming
> languages (e.g., C++), i.e., the relationships between
> 
>     memory_order_release
>     memory_order_relaxed
>     memory_order_acquire
>     memory_order_seq_cst
>     ...
> 
> and those used in the kernel:
> 
>     READ_ONCE() / WRITE_ONCE()
>     rmb() / wmb() / mb() / smp_mb()
>     ...
> 
> Any materials for that?

The URL I posted above:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0124r4.html

							Thanx, Paul


      parent reply	other threads:[~2018-04-11  3:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180410121408.4fik54wftqvesk65@HP>
     [not found] ` <20180410152024.rq6aynzvbgeyogma@HP>
     [not found]   ` <20180410170409.GX3948@linux.vnet.ibm.com>
2018-04-11  2:46     ` different kind of memory reordering clarification Yubin Ruan
2018-04-11  3:00       ` Yubin Ruan
2018-04-11  3:09         ` Paul E. McKenney
2018-04-11  3:43           ` Yubin Ruan
2018-04-11  3:59             ` Yubin Ruan
2018-04-11 17:54               ` Paul E. McKenney
2018-04-11  3:02       ` Paul E. McKenney [this message]

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=20180411030230.GG3948@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=ablacktshirt@gmail.com \
    --cc=perfbook@vger.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.