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


Re: [Xen-devel] Linux spin lock enhancement on xen

To: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Linux spin lock enhancement on xen
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 17 Aug 2010 08:33:40 +0100
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Delivery-date: Tue, 17 Aug 2010 00:34:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100816183357.08623c4c@xxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acs9rGB3fh70DpoTS06Z3sWXFz1g/gAMiKJG
Thread-topic: [Xen-devel] Linux spin lock enhancement on xen
User-agent: Microsoft-Entourage/
How does this compare with Jeremy's existing paravirtualised spinlocks in
pv_ops? They required no hypervsior changes. Cc'ing Jeremy.

 -- Keir

On 17/08/2010 02:33, "Mukesh Rathor" <mukesh.rathor@xxxxxxxxxx> wrote:

> Hi guys,
> Check out the attached patches. I changed the spin lock semantics so the
> lock contains the vcpu id of the vcpu holding it. This then tells xen
> to make that vcpu runnable if not already running:
> Linux:
>    spin_lock()
>        if (try_lock() == failed)
>            loop X times
>            if (try_lock() == failed)
>                sched_op_yield_to(vcpu_num of holder)
>                start again;
>            endif
>        endif
> Xen:
>      sched_op_yield_to:
>           if (vcpu_running(vcpu_num arg))
>               do nothing
>           else
>               vcpu_kick(vcpu_num arg)
>               do_yield()
>           endif
> In my worst case test scenario, I get about 20-36% improvement when the
> system is two to three times over provisioned.
> Please provide any feedback. I would like to submit official patch for
> SCHEDOP_yield_to in xen.
> thanks,
> Mukesh

Xen-devel mailing list