[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1277886263.1868.76.camel@laptop>
Date: Wed, 30 Jun 2010 10:24:23 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jan Beulich <JBeulich@...ell.com>
Cc: mingo@...e.hu, tglx@...utronix.de, hpa@...or.com,
jeremy.fitzhardinge@...rix.com,
Ky Srinivasan <KSrinivasan@...ell.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4, v2] x86: enlightenment for ticket spin locks -
base implementation
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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists