The code for __raw_spin_unlock contains the following comment:
/*
* __raw_spin_unlock based on writing $1 to the low byte.
* This method works. Despite all the confusion.
* (except on PPro SMP or if we are using OOSTORE, so we use xchgb there)
* (PPro errata 66, 92)
*/
Yet the Wikipedia article on spinlocks says:
http://en.wikipedia.org/wiki/Spinlock
"In theory, spin_unlock could use an unlocked MOV instead of the locked
XCHG, however some processors (notably, some Cyrix processors and some
revisions of the Intel Pentium III) will do the wrong thing and data
protected by the lock could be corrupted."
Does anyone know for sure who is right? I assume if the Linux kernel was
wrong, it would probably be blowing up by now. Or does it rely on something
that isn't guaranteed but happens to work on all current hardware? Or
perhaps it's some kind of very rare issue. What is the source for the
comment about "some revisions of the Intel Pentium II"? Does one know?
Is 'movb' okay, but perhaps some other type of instructions might not
work, such as a 32-bit operation?
DS
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]