Thread (8 messages) 8 messages, 4 authors, 2012-02-10

Re: on memory barriers and cachelines

From: Paul E. McKenney <hidden>
Date: 2012-02-01 14:22:41

On Wed, Feb 01, 2012 at 10:33:58AM +0100, Peter Zijlstra wrote:
Hi all,

So I was talking to Paul yesterday and he mentioned how the SRCU sync
primitive has to use extra synchronize_sched() calls in order to avoid
smp_rmb() calls in the srcu_read_{un,}lock() calls.

Now memory barriers are usually explained as observable order between
two (or more) unrelated variables, as Documentation/memory-barriers.txt
does in great detail.

What I couldn't find in there though, is what happens when both
variables are on the same cacheline. The "The effects of the CPU cache"
and "Cache coherency" sections are closest but leave me wanting on this
point.

Can we get some implicit behaviour from being on the same cacheline? Or
can this memory access queue still totally wreck the game?
I don't know of any guarantees in this area, but am checking with
hardware architects for a couple of architectures.

							Thanx, Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help