On Thu, 9 Aug 2007, Chris Snook wrote:Segher Boessenkool wrote:Because we don't need to, and it hurts performance.You didn't answer my question: are there any downsides to usingThe only safe way to get atomic accesses is to writeThe assumption that aligned word reads and writes are atomic, and that
assembler code. Are there any downsides to that? I don't
see any.
words are aligned unless explicitly packed otherwise, is endemic in the
kernel. No sane compiler violates this assumption. It's true that we're
not portable to insane compilers after this patch, but we never were in
the first place.
explicit coded-in-assembler accesses for atomic accesses? You
can handwave all you want that it should "just work" with
volatile accesses, but volatility != atomicity, volatile in C
is really badly defined, GCC never officially gave stronger
guarantees, and we have a bugzilla full of PRs to show what a
minefield it is.
So, why not use the well-defined alternative?
It hurts performance by implementing 32-bit atomic reads in assembler?