All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] different kinds of memory barrier
@ 2017-02-13 13:55 Yubin Ruan
  2017-02-13 19:06 ` Paul E. McKenney
  0 siblings, 1 reply; 10+ messages in thread
From: Yubin Ruan @ 2017-02-13 13:55 UTC (permalink / raw)
  To: perfbook

It have been mentioned in the book that there are three kinds of memory 
barriers: smp_rmb, smp_wmb, smp_mb

I am confused about their actual semantic:

The book says that(B.5 paragraph 2, perfbook2017.01.02a):

for smp_rmb():
     "The effect of this is that a read memory barrier orders
      only loads on the CPU that executes it, so that all loads
      preceding the read memory barrier will appear to have
      completed before any load following the read memory
      barrier"

for smp_wmb():
     "so that all stores preceding the write memory barrier will
      appear to have completed before any store following the
      write memory barrier"

I wonder, is there any primitive "X" which can guarantees:
     "that all 'loads' preceding the X will appear to have completed
      before any *store* following the X "

and similarly:
     "that all 'store' preceding the X will appear to have completed
      before any *load* following the X "

I know I can use the general smp_mb() for that, but that is a little too 
general.

Do I miss/mix anything ?

regards,
Yubin Ruan

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-18 12:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13 13:55 [Question] different kinds of memory barrier Yubin Ruan
2017-02-13 19:06 ` Paul E. McKenney
2017-02-14 10:35   ` Yubin Ruan
     [not found]     ` <20170216185845.GJ30506@linux.vnet.ibm.com>
     [not found]       ` <70c1256d-1045-f4df-3423-b326b28ff86d@gmail.com>
2017-02-17  9:20         ` Yubin Ruan
2017-02-17 15:35           ` Paul E. McKenney
2017-02-17 16:22             ` Yubin Ruan
2017-02-17 17:32               ` Paul E. McKenney
2017-02-18  5:07                 ` Yubin Ruan
2017-02-18  6:58                   ` Akira Yokosawa
2017-02-18 12:09                     ` Yubin Ruan

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.