Re: [Question] different kinds of memory barrier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2017 at 09:55:50PM +0800, Yubin Ruan wrote:
> 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 ?

Well, the memory-ordering material is a bit dated.  There is some work
underway to come up with a better model, and I presented on it a couple
weeks ago:

http://www.rdrop.com/users/paulmck/scalability/paper/LinuxMM.2017.01.19a.LCA.pdf

This presentation calls out a tarball that includes some .html files
that have much better explanations, and this wording will hopefully
be reflected in an upcoming version of the book.  Here is a direct
URL for the tarball:

http://www.rdrop.com/users/paulmck/scalability/paper/LCA-LinuxMemoryModel.2017.01.15a.tgz 

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux