The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Question about memory barriers
@ 2006-02-02 21:12 Alan Stern
  2006-02-02 21:32 ` linux-os (Dick Johnson)
  2006-02-02 21:37 ` Roland Dreier
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Stern @ 2006-02-02 21:12 UTC (permalink / raw)
  To: Kernel development list

The kernel's documentation about memory barriers is rather skimpy.  I 
gather that rmb() guarantees that all preceding reads will have completed 
before any following reads are made, and wmb() guarantees that all 
preceding writes will have completed before any following writes are made.  
I also gather that mb() is essentially the same as rmb() and wmb() put 
together.

But suppose I need to prevent a read from being moved past a write?  It 
doesn't look like either rmb() or wmb() will do this.  And if mb() is the 
same as "rmb(); wmb();" then it won't either.  So what's the right thing 
to do?

Alan Stern


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

end of thread, other threads:[~2006-02-02 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 21:12 Question about memory barriers Alan Stern
2006-02-02 21:32 ` linux-os (Dick Johnson)
2006-02-02 21:37 ` Roland Dreier
2006-02-02 21:49   ` Alan Stern
2006-02-02 21:52     ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox