Thread (305 messages) flat view 305 messages, 27 authors, 2007-09-11

Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2007-08-21 05:49:30
Also in: linux-arch, lkml


On Mon, 20 Aug 2007, Chris Snook wrote:
What about barrier removal?  With consistent semantics we could optimize a
fair amount of code.  Whether or not that constitutes "premature" optimization
is open to debate, but there's no question we could reduce our register wiping
in some places.
Why do people think that barriers are expensive? They really aren't. 
Especially the regular compiler barrier is basically zero cost. Any 
reasonable compiler will just flush the stuff it holds in registers that 
isn't already automatic local variables, and for regular kernel code, that 
tends to basically be nothing at all.

Ie a "barrier()" is likely _cheaper_ than the code generation downside 
from using "volatile".

		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