Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934584Ab0KQILb (ORCPT ); Wed, 17 Nov 2010 03:11:31 -0500 Received: from vpn.id2.novell.com ([195.33.99.129]:36881 "EHLO vpn.id2.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934514Ab0KQIL3 convert rfc822-to-8bit (ORCPT ); Wed, 17 Nov 2010 03:11:29 -0500 Message-Id: <4CE39C3C0200007800022AE2@vpn.id2.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 17 Nov 2010 08:11:24 +0000 From: "Jan Beulich" To: "Jeremy Fitzhardinge" Cc: "Jeremy Fitzhardinge" , "Eric Dumazet" , , "Peter Zijlstra" , "Nick Piggin" , "Srivatsa Vaddagiri" , "Linux Virtualization" , "Xen-devel" , "Mathieu Desnoyers" , "Avi Kivity" , "Linux Kernel Mailing List" , "H. Peter Anvin" Subject: Re: [PATCH 09/14] xen/pvticketlock: Xen implementation for PV ticket locks References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 36 >>> On 16.11.10 at 22:08, Jeremy Fitzhardinge wrote: > +static void xen_lock_spinning(struct arch_spinlock *lock, unsigned want) > { > - struct xen_spinlock *xl = (struct xen_spinlock *)lock; > - struct xen_spinlock *prev; > int irq = __get_cpu_var(lock_kicker_irq); > - int ret; > + struct xen_lock_waiting *w = &__get_cpu_var(lock_waiting); > + int cpu = smp_processor_id(); > u64 start; > > /* If kicker interrupts not initialized yet, just spin */ > if (irq == -1) > - return 0; > + return; > > start = spin_time_start(); > > - /* announce we're spinning */ > - prev = spinning_lock(xl); > + w->want = want; > + w->lock = lock; > + > + /* This uses set_bit, which atomic and therefore a barrier */ > + cpumask_set_cpu(cpu, &waiting_cpus); Since you don't allow nesting, don't you need to disable interrupts before you touch per-CPU state? Jan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/