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
--
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