mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Schwartz" <davids@webmaster.com>
To: "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: spinlock __raw_spin_unlock : comment disagrees with Wikipedia article
Date: Wed, 22 Feb 2006 16:51:46 -0800	[thread overview]
Message-ID: <MDEHLPKNGKAHNMBLJOLKKEMGKEAB.davids@webmaster.com> (raw)


    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



                 reply	other threads:[~2006-02-23  0:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MDEHLPKNGKAHNMBLJOLKKEMGKEAB.davids@webmaster.com \
    --to=davids@webmaster.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®