But this is a perfect example of exactly what I'm talking about:
THAT CODE IS HORRIBLY BUGGY!
It's not the spinlocks that are broken, it's that damn code.
What a piece of crap.
Anybody who ever waits for a lock by busy-looping over it is BUGGY,
dammit!
The only correct way to wait for a lock is:
(a) try it *once* with an atomic r-m-w
(b) loop over just _reading_ it (and something that implies a memory
barrier, _not_ "__delay()". Use "cpu_relax()" or "smp_rmb()")
(c) rinse and repeat.
and code like the above should just be shot on sight.
So don't blame the spinlocks or the hardware for crap code.
Linus
-