From: Peter Zijlstra <peterz@infradead.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
jeremy.fitzhardinge@citrix.com,
Ky Srinivasan <KSrinivasan@novell.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4, v2] x86: enlightenment for ticket spin locks - base implementation
Date: Wed, 30 Jun 2010 10:24:23 +0200 [thread overview]
Message-ID: <1277886263.1868.76.camel@laptop> (raw)
In-Reply-To: <4C2A1FE902000078000089E1@vpn.id2.novell.com>
On Tue, 2010-06-29 at 15:31 +0100, Jan Beulich wrote:
> @@ -62,18 +110,20 @@ static __always_inline void __ticket_spi
> {
> short inc = 0x0100;
>
> - asm volatile (
> + alternative_common(
> LOCK_PREFIX "xaddw %w0, %1\n"
> "1:\t"
> "cmpb %h0, %b0\n\t"
> - "je 2f\n\t"
> + "je 2f\n\t",
> "rep ; nop\n\t"
> "movb %1, %b0\n\t"
> /* don't need lfence here, because loads are in-order
> */
> "jmp 1b\n"
> - "2:"
> - : "+Q" (inc), "+m" (lock->slock)
> - :
> + "2:",
> + ALTERNATIVE_TICKET_LOCK,
> + X86_FEATURE_SPINLOCK_YIELD,
> + ASM_OUTPUT2("+Q" (inc), "+m" (lock->slock)),
> + [stub] "i" (virt_spin_lock_stub)
> : "memory", "cc");
> }
Also, instead of obfuscating __ticket_spin_lock(), can't you provide a
whole alternative arch_spin_lock() implementation and switch between
that and whatever bat-shit these paravirt people come up with?
prev parent reply other threads:[~2010-06-30 8:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-29 14:31 [PATCH 1/4, v2] x86: enlightenment for ticket spin locks - base implementation Jan Beulich
2010-06-30 8:05 ` Peter Zijlstra
2010-06-30 9:00 ` Jan Beulich
2010-06-30 9:11 ` Peter Zijlstra
2010-06-30 9:56 ` Jeremy Fitzhardinge
2010-06-30 11:43 ` Jan Beulich
2010-06-30 11:48 ` Peter Zijlstra
2010-06-30 11:54 ` Jan Beulich
2010-06-30 10:50 ` Jeremy Fitzhardinge
2010-06-30 11:52 ` Jan Beulich
2010-06-30 12:53 ` Jeremy Fitzhardinge
2010-06-30 13:21 ` Jan Beulich
2010-06-30 13:28 ` Jeremy Fitzhardinge
2010-06-30 9:26 ` Peter Zijlstra
2010-06-30 9:32 ` Gleb Natapov
2010-06-30 8:24 ` Peter Zijlstra [this message]
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=1277886263.1868.76.camel@laptop \
--to=peterz@infradead.org \
--cc=JBeulich@novell.com \
--cc=KSrinivasan@novell.com \
--cc=hpa@zytor.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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