Thread (1 message) 1 message, 1 author, 2004-07-14

Re: [BK PATCHES] 2.6.x net driver fixes

From: Linus Torvalds <torvalds@osdl.org>
Date: 2004-07-14 21:28:11


On Wed, 14 Jul 2004, Jeff Garzik wrote:
quoted
The weaker ordering constraint is called "read_barrier_depends()", and
should be a no-op on all but alpha. Would you want to use that to fix the
alpha case too?
What would the proper fix be?

	rmb();
	read_barrier_depends();
No, just a

	index = *indexpointer;
	read_barrier_depends();
	data = dataptr[index];

which on most architectures is a no-op, but in case the hardware might do
data or address speculation, and needs a dependent load barrier, it will
do the right thing.

For stuff that isn't data dependent, you have to use the full rmb(), which 
obviously isn't a no-op on most setups.

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