If local speculative reads are a problem, perhaps this would be faster
than "lock; btrl $0,%0":
"movl $0,%0" then rmb().
The rmb() does a locked operation but no cross-CPU traffic on a PPro.
Thus local reads and writes are fully serialised, and bus traffic is
limited to the write which we believe is read correctly by other
processors.
The rmb() can be a separate asm so that GCC can place some register
operations in between if it's that clever (which it isn't, but it might
be one day).
OTOH, I don't see how speculative reads can be a problem. You're
speculatively reading from /outside/ a locked region so anything goes.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/