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: Wed, 18 Aug 2010 19:52:36 -0700 [thread overview]
Message-ID: <20100818195236.1b898e75@mantra.us.oracle.com> (raw)
In-Reply-To: <4C6C0C3D.2070508@goop.org>
On Wed, 18 Aug 2010 09:37:17 -0700
Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> (They don't leave for no reason; they leave when they're told they can
> take the lock next.)
>
> I don't see why the guest should micromanage Xen's scheduler
> decisions. If a VCPU is waiting for another VCPU and can put itself
> to sleep in the meantime, then its up to Xen to take advantage of
> that newly freed PCPU to schedule something. It may decide to run
> something in your domain that's runnable, or it may decide to run
> something else. There's no reason why the spinlock holder is the
> best VCPU to run overall, or even the best VCPU in your domain.
>
> My view is you should just put any VCPU which has nothing to do to
> sleep, and let Xen sort out the scheduling of the remainder.
Agree for the most part. But if we can spare the cost of a vcpu coming
on a cpu, realizing it has nothing to do and putting itself to sleep, by a
simple solution, we've just saved cycles. Often we are looking for tiny
gains in the benchmarks against competition.
Yes we don't want to micromanage xen's schedular. But if a guest knows
something that the schedular does not, and has no way of knowing it,
then it would be nice to be able to exploit that. I didn't think a vcpu
telling xen that it's not making forward progress was intrusive.
Another approach, perhaps better, is a hypercall that allows to temporarily
boost a vcpu's priority. What do you guys think about that? This would
be akin to a system call allowing a process to boost priority. Or
some kernels, where a thread holding a lock gets a temporary bump in
the priority because a waitor tells the kernel to.
> I'm not sure I understand this point. If you're pinning vcpus to
> pcpus, then presumably you're not going to share a pcpu among many,
> or any vcpus, so the lock holder will be able to run any time it
> wants. And a directed yield will only help if the lock waiter is
> sharing the same pcpu as the lock holder, so it can hand over its
> timeslice (since making the directed yield preempt something already
> running in order to run your target vcpu seems rude and ripe for
> abuse).
No, if a customer licences 4 cpus, and runs a guest with 12 vcpus.
You now have 12 vcpus confined to the 4 physical.
> Presumably the number of pcpus are also going up, so the amount of
> per-pcpu overcommit is about the same.
Unless the vcpus's are going up faster than pcpus :)....
Thanks,
Mukesh
next prev parent reply other threads:[~2010-08-19 2:52 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
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 [this message]
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=20100818195236.1b898e75@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).