From: Andi Kleen <ak@muc.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@osdl.org>,
pwil3058@bigpond.net.au, akpm@osdl.org,
linux-kernel@vger.kernel.org
Subject: Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs
Date: Fri, 28 Jan 2005 07:01:56 +0100 [thread overview]
Message-ID: <m14qh23xd7.fsf@muc.de> (raw)
In-Reply-To: <20050128042815.GA29751@elte.hu> (Ingo Molnar's message of "Fri, 28 Jan 2005 05:28:15 +0100")
Ingo Molnar <mingo@elte.hu> writes:
>
> interestingly, the x86 spinlock implementation uses a LOCK-ed
> instruction only on acquire - it uses a simple atomic write (and
> implicit barrier assumption) on the way out:
>
> #define spin_unlock_string \
> "movb $1,%0" \
> :"=m" (lock->slock) : : "memory"
>
> no LOCK prefix. Due to this spinlocks can sometimes be _cheaper_ than
> doing the same via atomic inc/dec.
Unfortunately kernels are often compiled for PPro and on those
an LOCK prefix is used anyways to work around some bugs in early
steppings. This makes spinlocks considerably slower (there are some
lock intensive not even so micro benchmarks that show the difference clearly)
It uses then
#define spin_unlock_string \
"xchgb %b0, %1" \
:"=q" (oldval), "=m" (lock->lock) \
:"0" (oldval) : "memory"
which has an implicit LOCK and is equally slow.
I looked some time ago at patching it at runtime using alternative(),
but it would have bloated the patch tables a lot. Another way would
be a CONFIG_PPRO_BUT_UP_ON_BUGGY_ONES, but it is hard to find the exact
steppings with the problems.
-Andi
next prev parent reply other threads:[~2005-01-28 6:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-16 11:32 [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs Ingo Molnar
2004-11-16 22:19 ` Peter Williams
2004-11-16 23:28 ` Ingo Molnar
2004-11-16 23:10 ` Linus Torvalds
2004-11-17 10:26 ` Ingo Molnar
2004-11-17 15:52 ` Linus Torvalds
2004-11-18 16:21 ` Ingo Molnar
2005-01-28 0:53 ` Paul Jackson
2005-01-28 1:06 ` Linus Torvalds
2005-01-28 2:14 ` Paul Jackson
2005-01-28 4:28 ` Ingo Molnar
2005-01-28 5:18 ` Paul Jackson
2005-01-28 6:01 ` Andi Kleen [this message]
2004-11-16 23:48 ` Peter Williams
2004-11-16 22:49 ` Nick Piggin
2004-11-16 23:03 ` Nick Piggin
2004-11-16 23:32 ` Peter Williams
2004-11-16 23:37 ` Nick Piggin
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=m14qh23xd7.fsf@muc.de \
--to=ak@muc.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pwil3058@bigpond.net.au \
--cc=torvalds@osdl.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