xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Keir,
	"Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Fraser <keir.fraser@eu.citrix.com>
Subject: Re: Linux spin lock enhancement on xen
Date: Tue, 17 Aug 2010 18:58:07 -0700	[thread overview]
Message-ID: <20100817185807.10628599@mantra.us.oracle.com> (raw)
In-Reply-To: <4C6ACA28.7030104@goop.org>

On Tue, 17 Aug 2010 10:43:04 -0700
Jeremy Fitzhardinge <jeremy@goop.org> wrote:

>  On 08/16/2010 06:33 PM, Mukesh Rathor wrote:
> > 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.
> 
> This approach only works for old-style spinlocks.  Ticketlocks also
> have the problem of making sure the next vcpu gets scheduled on
> unlock.

Well, unfortunately, looks like old-style spinlocks are gonna be around 
for a very long time. I've heard there are customers still on EL3!


> Have you looked at the pv spinlocks I have upstream in the pvops
> kernels, which use the (existing) poll hypercall to block the waiting
> vcpu until the lock is free?
>     J

>How does this compare with Jeremy's existing paravirtualised spinlocks
>in pv_ops? They required no hypervsior changes. Cc'ing Jeremy.
> -- Keir

Yeah, I looked at it today. What pv-ops is doing is forcing a yield
via a fake irq/event channel poll, after storing the lock pointer in
a per cpu area. The unlock'er then IPIs the vcpus waiting. The lock
holder may not be running tho, and there is no hint to hypervisor
to run it. So you may have many waitor's come and leave for no
reason.

To me this is more of an overhead than needed in a guest. In my
approach, the hypervisor is hinted exactly which vcpu is the 
lock holder. Often many VCPUs are pinned to a set of physical cpus
due to licensing and other reasons. So this really helps a vcpu
that is holding a spin lock, wanting to do some possibly real
time work, get scheduled and move on. Moreover, number of vcpus is
going up pretty fast.

Thanks,
Mukesh

  reply	other threads:[~2010-08-18  1:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  1:33 Linux spin lock enhancement on xen Mukesh Rathor
2010-08-17  7:33 ` Keir Fraser
2010-08-17  7:53 ` Jan Beulich
2010-08-18  1:58   ` Mukesh Rathor
2010-08-17 14:34 ` Ky Srinivasan
2010-08-18  1:58   ` Mukesh Rathor
2010-08-17 17:43 ` Jeremy Fitzhardinge
2010-08-18  1:58   ` Mukesh Rathor [this message]
2010-08-18 16:37     ` Jeremy Fitzhardinge
2010-08-18 17:09       ` Keir Fraser
2010-08-19  2:52         ` Mukesh Rathor
2010-08-24  8:08         ` George Dunlap
2010-08-24  8:20           ` Keir Fraser
2010-08-24  8:43             ` George Dunlap
2010-08-24  8:48             ` Jan Beulich
2010-08-24  9:09               ` George Dunlap
2010-08-24 13:25                 ` Jan Beulich
2010-08-24 16:11                   ` George Dunlap
2010-08-26 14:08                     ` Tim Deegan
2010-08-25  1:03           ` Dong, Eddie
2010-08-26  2:13           ` Mukesh Rathor
2010-08-19  2:52       ` Mukesh Rathor
2010-08-23 21:33         ` Jeremy Fitzhardinge

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=20100817185807.10628599@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=jeremy@goop.org \
    --cc=keir.fraser@eu.citrix.com \
    /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;
as well as URLs for NNTP newsgroup(s).