This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: [PATCH RFC 09/12] xen/pvticketlock: Xen implementation f

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH RFC 09/12] xen/pvticketlock: Xen implementation for PV ticket locks
From: Srivatsa Vaddagiri <vatsa@xxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Jan 2011 21:57:18 +0530
Cc: Nick Piggin <npiggin@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, suzuki@xxxxxxxxxx, Avi Kivity <avi@xxxxxxxxxx>
Delivery-date: Tue, 18 Jan 2011 08:35:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C9FCA8F.4070802@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1279328276.git.jeremy.fitzhardinge@xxxxxxxxxx> <32e63cc978ec4b3f36c7f641ce48b3d86aed22ed.1279328276.git.jeremy.fitzhardinge@xxxxxxxxxx> <20100926113910.GA6719@xxxxxxxxxxxxxxxxxx> <4C9FCA8F.4070802@xxxxxxxx>
Reply-to: vatsa@xxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Sun, Sep 26, 2010 at 03:34:55PM -0700, Jeremy Fitzhardinge wrote:
>  On 09/26/2010 04:39 AM, Srivatsa Vaddagiri wrote:
> > On Fri, Jul 16, 2010 at 06:03:04PM -0700, Jeremy Fitzhardinge wrote:
> >> Replace the old Xen implementation of PV spinlocks with and implementation
> >> of xen_lock_spinning and xen_unlock_kick.
> > I see that the old implementation took care of a spinlock() call being
> > interrupted by another spinlock (in interrupt handler), by saving/restoring 
> > old lock of interest. We don't seem to be doing that in this new version?
> > Won't that lead to loss of wakeup -> hang?

Sorry about coming back late on this, but as I was looking at the most recent
version of pv-ticketlocks, this came up in my mind again ..

> No, interrupts are disabled while waiting to take the lock, so it isn't
> possible for an interrupt to come in.

Where are we disabling interrupts? Is it in xen_poll_irq()?

>  With the old-style locks it was
> reasonable to leave interrupts enabled while spinning, but with ticket
> locks it isn't.
> (I haven some prototype patches to implement nested spinning of ticket
> locks,

Hmm ..where is nested spinning allowed/possible? Process context will
disable interrupts/bh from wanting the same (spin-)lock it is trying to

> by allowing the nested taker to steal the queue position of the
> outer lock-taker, and switch its ticket with a later one.  But there's a
> fundamental problem with the idea: each lock taker needs to take a
> ticket.  If you don't allow nesting, then the max amount of tickets
> needed = number of cpus-1; however, with nesting, the max number of
> tickets = ncpus * max-nesting-depth, so the size of the ticket type must
> be larger for a given number of cpus, or the max number of cpus must be
> reduced.)

- vatsa

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>