* spinlock __raw_spin_unlock : comment disagrees with Wikipedia article
@ 2006-02-23 0:51 David Schwartz
0 siblings, 0 replies; only message in thread
From: David Schwartz @ 2006-02-23 0:51 UTC (permalink / raw)
To: Linux-Kernel@Vger. Kernel. Org
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-02-23 0:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 0:51 spinlock __raw_spin_unlock : comment disagrees with Wikipedia article David Schwartz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®