From: Dario Faggioli <dario.faggioli@citrix.com>
To: Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>
Cc: edgar.iglesias@xilinx.com, george.dunlap@eu.citrix.com,
nd@arm.com, Punit Agrawal <punit.agrawal@arm.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen/arm: introduce vwfi parameter
Date: Mon, 20 Feb 2017 12:15:30 +0100 [thread overview]
Message-ID: <1487589330.6732.174.camel@citrix.com> (raw)
In-Reply-To: <a173bcb3-04f0-4b02-70df-6b9c33a56cbf@arm.com>
[-- Attachment #1.1: Type: text/plain, Size: 5378 bytes --]
On Sun, 2017-02-19 at 21:27 +0000, Julien Grall wrote:
> Hi Dario,
>
Hi,
> On 02/18/2017 01:47 AM, Dario Faggioli wrote:
> > - vcpu A yields, and there are no runnable but not running vcpus
> > around. In this case, A gets to run again. Full stop.
>
> Which turn to be the busy looping I was mentioning when one vCPU is
> assigned to a pCPU.
>
Absolutely. Actually, it would mean busy looping, no matter whether
vCPUs are assigned or not.
As I said already, it's not exactly identical, but it would have a very
similar behavior of the Linux's idle=poll option:
http://tomoyo.osdn.jp/cgi-bin/lxr/source/Documentation/kernel-parameters.txt?v=linux-4.9.9#L1576
1576 idle= [X86]
1577 Format: idle=poll, idle=halt, idle=nomwait
1578 Poll forces a polling idle loop that can slightly
1579 improve the performance of waking up a idle CPU, but
1580 will use a lot of power and make the system run hot.
1581 Not recommended.
And as I've also said, I don't see it as a solution to wakeup latency
problems, not one that I'd like to recommend using, outside of testing
and debugging. It perhaps may be a useful testing and debugging aid,
though.
> This is not the goal of WFI and I would be really
> surprised that embedded folks will be happy with a solution using
> more
> power.
>
Me neither. It's a showstopper for anything that's battery power or may
incur in thermal/cooling issues. Outside
So, just to be clear, I'm happy to help and assist in understanding the
scheduling background and implications, but I am equally happy to leave
the decision of whether or not this is something nice or desirable to
have (as an option) on ARM. :-)
I've never been a fan of it, and never used it, on Linux on x86, not
even when actually working on real-time and low-latency stuff. That
being said, I also personally think that having the option would be no
harm, but I understand concerns that, when an option is there, people
will try to use it in the weirdest way, and then comply at your 'door'
if their CPU went on fire! :-O
> > What will never happen is that a yielding vcpu, by busy looping,
> > prevents other runnable (and non yielding) vcpus to run. And if it
> > does, it's a bug. :-)
>
> I didn't say it will prevent another vCPU to run. But it will at
> least
> use slot that could have been used for good purpose by another pCPU.
>
Not really. Maybe I wasn't clear on explaining yielding, or maybe I'm
not getting what you're trying to say.
It indeed does depend a little bit on the implementation of yield, but
it won't (or at least must not) happen for busy looping issuing yield()
to be much different for the pCPU when that is happening to be sleeping
in deep C-state (or ARM equivalente). Performance aside, of course.
> So in similar workload Xen will perform worst with vwfi=idle, not
> even
> mentioning the power consumption...
>
It'd probably be a little bit more inefficient, even performance wise,
if, e.g., scheduler specific yielding code acquire locks, or means that
there is one more vCPU in the runqueues to be dealt with, but nothing
than that. And whether or not this would be significant or noticeable,
I don't know (should be measured, if interesting).
> > In fact, in work conserving schedulers, if pCPU x becomes idle, it
> > means there is _nothing_ that can execute on x itself around. And
> > our
> > schedulers are (with the exception of ARRINC, and if not using caps
> > in
> > Credit1) work conserving, or at least they want and try to be an as
> > much work conserving as possible.
>
> My knowledge of the scheduler is limited. Does the scheduler take
> into
> account the cost of context switch when scheduling? When do you
> decide
> when to run the idle vCPU? Is it only the no other vCPU are runnable
> or
> do you have an heuristic?
>
Again, not sure I understand. Context switches, between running vCPUs,
must happen where the scheduling algorithm decides they must happen.
You can try to design an algorithm that requires not too many context
switches, or introduce countermeasures (we have something like that),
but apart from these, I don't know what (else?) you may refer to when
asking about "take into account the cost of context switch".
We do try to take into account the cose of migration, i.e., moving a
vCPU from a pCPU to another... but that's an entirely different thing.
About the idle vCPU... I think the answer to your question is yes.
Credit and Credit2 are work conserving schedulers, so they only let a
pCPU go idle, if there is no one wanting to run in the system (well, in
Credit2, this may not be 100% true, until the load balancer gets to
execute, but in practise, it happens very few and very infrequently).
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-20 11:16 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1487286292-29502-1-git-send-email-sstabellini@kernel.org>
[not found] ` <a271394a-6c76-027c-fb08-b3fe775224ba@arm.com>
2017-02-17 22:50 ` [PATCH] xen/arm: introduce vwfi parameter Stefano Stabellini
2017-02-18 1:47 ` Dario Faggioli
2017-02-19 21:27 ` Julien Grall
2017-02-20 10:43 ` George Dunlap
2017-02-20 11:15 ` Dario Faggioli [this message]
2017-02-19 21:34 ` Julien Grall
2017-02-20 11:35 ` Dario Faggioli
2017-02-20 18:43 ` Stefano Stabellini
2017-02-20 18:45 ` George Dunlap
2017-02-20 18:49 ` Stefano Stabellini
2017-02-20 18:47 ` Stefano Stabellini
2017-02-20 18:53 ` Julien Grall
2017-02-20 19:20 ` Dario Faggioli
2017-02-20 19:38 ` Julien Grall
2017-02-20 22:53 ` Dario Faggioli
2017-02-21 0:38 ` Stefano Stabellini
2017-02-21 8:10 ` Julien Grall
2017-02-21 9:24 ` Dario Faggioli
2017-02-21 13:04 ` Julien Grall
2017-02-21 7:59 ` Julien Grall
2017-02-21 9:09 ` Dario Faggioli
2017-02-21 12:30 ` Julien Grall
2017-02-21 13:46 ` George Dunlap
2017-02-21 15:07 ` Dario Faggioli
2017-02-21 17:49 ` Stefano Stabellini
2017-02-21 17:56 ` Julien Grall
2017-02-21 18:30 ` Stefano Stabellini
2017-02-21 19:20 ` Julien Grall
2017-02-22 4:21 ` Edgar E. Iglesias
2017-02-22 17:22 ` Stefano Stabellini
2017-02-23 9:19 ` Edgar E. Iglesias
2017-02-21 18:17 ` George Dunlap
2017-02-22 16:40 ` Dario Faggioli
2017-02-21 15:14 ` Julien Grall
2017-02-21 16:59 ` George Dunlap
2017-02-21 18:03 ` Stefano Stabellini
2017-02-21 18:24 ` Julien Grall
2017-02-21 16:51 ` Dario Faggioli
2017-02-21 17:39 ` Stefano Stabellini
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=1487589330.6732.174.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=edgar.iglesias@xilinx.com \
--cc=george.dunlap@eu.citrix.com \
--cc=julien.grall@arm.com \
--cc=nd@arm.com \
--cc=punit.agrawal@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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).