From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <dunlapg@umich.edu>, Tianyang Chen <tiche@seas.upenn.edu>
Cc: Meng Xu <xumengpanda@gmail.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Questions about the use of idle_vcpu[]
Date: Mon, 18 Jan 2016 12:00:00 +0100 [thread overview]
Message-ID: <1453114800.11427.78.camel@citrix.com> (raw)
In-Reply-To: <CAFLBxZYf+NXL3FvZGKJP1XTfzTbmwrDBpMKDCG2su_vyqyL+Og@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2821 bytes --]
On Mon, 2016-01-18 at 10:47 +0000, George Dunlap wrote:
> On Fri, Jan 15, 2016 at 1:04 AM, Tianyang Chen <tiche@seas.upenn.edu>
>
> > If an idle vcpu is picked, the ret.time is set accordingly in both
> > credit
> > and credit2 by checking whether snext is idle. if so, credit
> > returns -1 and
> > credit2 returns 2ms. However, there is no corresponding code in the
> > RTDS
> > scheduler to handle this. When an idle_vcpu is picked, the value of
> > ret.time
> > would be 0 and the scheduler would be invoked again. What is the
> > logic
> > behind this?
>
> No real logic, as far as I can tell. :-) The ret.time return value
> tells the generic scheduling code when to set the next scheduler
> timer. According to the comment in xen/common/schedule.c:schedule(),
> returning a negative value means "don't bother setting a timer"
> (e.g.,
> no time limit). So credit1 does the right thing.
>
It does.
> It looks like credit2's behavior will probably prevent the processor
> from going into deeper power-saving states, and rtds' behavior might
> cause it to essentially busy-wait.
>
RTDS behavior is broken in many respect, including this, and in fact,
Meng and Tianyang are sending patches already to fix it (I'll let you
guys have my comments shortly :-P).
Credit2, AFAICR, could also avoid _always_ re-setting the timer, but it
does need to do that at least a few times, even when idle is selected,
because of the dynamic load tracking mechanism it includes. In fact,
that is based on a 'decaying average', which in turns relies on
csched2_schedule() to run and update the statistics, even when the cpu
is idle. If we don't do that, the load tracking mechanism will never
see that the cpu (well, it's actually the runqueue) is idle, and the
load will never go down! :-/
I've got patches for:
- extending the dynamic load tracking logic to all scheduler (iff
they want to use it, of course)
- only call {csched,csched2,rtds}_schedule() if necessary. That
means, if the pcpu/runqueue is idle (and if the dynamic tracking is
in use by the specific scheduler), only return a positive value
and set the timer if the dynamic load is >0, to allow it to decay
(if the pcpu/runqueue stays idle enough).
But they are on hold, while I'm finishing some other work.
> Dario / Meng, am I reading things right? If so, we should probably
> fix that...
>
Yep, and in fact, we're on it already. I hope to be able to post my
patches soon. :-)
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: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-01-18 11:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 1:04 Questions about the use of idle_vcpu[] Tianyang Chen
2016-01-18 10:47 ` George Dunlap
2016-01-18 11:00 ` Dario Faggioli [this message]
2016-01-18 12:37 ` George Dunlap
2016-01-18 12:47 ` Dario Faggioli
2016-01-18 14:12 ` Load calculation refresh in credit2 (was in Re: Questions about the use of idle_vcpu[]) George Dunlap
2016-01-19 9:23 ` Dario Faggioli
2016-01-18 16:07 ` Questions about the use of idle_vcpu[] Meng Xu
2016-01-18 16:32 ` Dario Faggioli
2016-01-18 16:41 ` Meng Xu
2016-01-19 22:59 ` Tianyang Chen
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=1453114800.11427.78.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=dunlapg@umich.edu \
--cc=tiche@seas.upenn.edu \
--cc=xen-devel@lists.xen.org \
--cc=xumengpanda@gmail.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).