xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Cc: Artem_Mygaiev@epam.com, xen-devel@lists.xensource.com,
	Andrii Anisov <andrii_anisov@epam.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: Notes on stubdoms and latency on ARM
Date: Sat, 8 Jul 2017 16:26:00 +0200	[thread overview]
Message-ID: <1499523960.3620.14.camel@citrix.com> (raw)
In-Reply-To: <CAOcqxo03+KAh_-fsw_Hzo75AJvTh9MixZGeg5xh5N_1roX=+Lw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4005 bytes --]

On Fri, 2017-07-07 at 10:03 -0700, Volodymyr Babchuk wrote:
> On 7 July 2017 at 09:41, Dario Faggioli <dario.faggioli@citrix.com>
> wrote:
> > 
> > Also, are you sure (e.g., because of how the Linux driver is done)
> > that
> > this always happen on one vCPU?
> 
> No, I can't guarantee that. Linux driver is single threaded, but I
> did
> nothing to pin in to a certain CPU.
> 
Ok, it was just to understand.

> > 
> > > - In total there are 6 vcpus active
> > > 
> > > I run test in DomU:
> > > real 113.08
> > > user 0.00
> > > sys 113.04
> > > 
> > 
> > Ok, so there's contention for pCPUs. Dom0's vCPUs are CPU hogs,
> > while,
> > if my assumption above is correct, the "SMC vCPU" of the DomU is
> > I/O
> > bound, in the sense that it blocks on an operation --which turns
> > out to
> > be SMC call to MiniOS-- then resumes and block again almost
> > immediately.
> > 
> > Since you are using Credit, can you try to disable context switch
> > rate
> > limiting? Something like:
> > 
> > # xl sched-credit -s -r 0
> > 
> > should work.
> 
> Yep. You are right. In the environment described above (Case 2) I now
> get much better results:
> 
>  real 1.85
> user 0.00
> sys 1.85
> 
Ok, glad to hear it worked! :-)

> > This looks to me like one of those typical scenario where rate
> > limiting
> > is counterproductive. In fact, every time that your SMC vCPU is
> > woken
> > up, despite being boosted, it finds all the pCPUs busy, and it
> > can't
> > preempt any of the vCPUs that are running there, until rate
> > limiting
> > expires.
> > 
> > That means it has to wait an interval of time that varies between 0
> > and
> > 1ms. This happens 100000 times, and 1ms*100000 is 100 seconds...
> > Which
> > is roughly how the test takes, in the overcommitted case.
> 
> Yes, looks like that was the case. Does this means that ratelimiting
> should be disabled for any domain that is backed up with device
> model?
> AFAIK, device models are working in the exactly same way.
> 
Rate limiting is a scheduler-wide thing. If it's on, all the context
switching rate of all domains is limited. If it's off, none is.

We'll have to see when we will have something that is less of a proof-
of-concept, but it is very likely that, for your use case, rate-
limiting should just be kept disabled (you can do that with a Xen boot
time parameter, so that you don't have to issue the command all the
times).

> > Yes, but it again makes sense. In fact, now there are 3 CPUs in
> > Pool-0,
> > and all are kept always busy by the the 3 DomU vCPUs running
> > endless
> > loops. So, when the DomU's SMC vCPU wakes up, has again to wait for
> > the
> > rate limit to expire on one of them.
> 
> Yes, as this was caused by ratelimit, this makes perfect sense. Thank
> you.
> 
> I tried number of different cases. Now execution time depends
> linearly
> on number of over-committed vCPUs (about +200ms for every busy vCPU).
> That is what I'm expected.
>
Is this the case even when MiniOS is in its own cpupool? If yes, it
means that what is that the slowdown is caused by the contention
between the vCPU that is doing the SMC calls, and the other vCPUs (of
either the same or other domains).

Which should not really happen in this case (or, at least, not to grow
linearly), since you are on Credit1, and in there, the SMC vCPU should
pretty much be always boosted, and hence get to be scheduled almost
immediately, no matter how many CPU hogs there are around.

Depending on the specific details of your usecase/product, we can try
to assign to the various domains different weights... but I need to
think a bit more about this...

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

  parent reply	other threads:[~2017-07-08 14:26 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 19:00 Notes on stubdoms and latency on ARM Stefano Stabellini
2017-05-19 19:45 ` Volodymyr Babchuk
2017-05-22 21:41   ` Stefano Stabellini
2017-05-26 19:28     ` Volodymyr Babchuk
2017-05-30 17:29       ` Stefano Stabellini
2017-05-30 17:33         ` Julien Grall
2017-06-01 10:28           ` Julien Grall
2017-06-17  0:17             ` Volodymyr Babchuk
2017-05-31  9:09         ` George Dunlap
2017-05-31 15:53           ` Dario Faggioli
2017-05-31 16:17             ` Volodymyr Babchuk
2017-05-31 17:45           ` Stefano Stabellini
2017-06-01 10:48             ` Julien Grall
2017-06-01 10:52             ` George Dunlap
2017-06-01 10:54               ` George Dunlap
2017-06-01 12:40               ` Dario Faggioli
2017-06-01 15:02                 ` George Dunlap
2017-06-01 18:27               ` Stefano Stabellini
2017-05-31 17:02       ` George Dunlap
2017-06-17  0:14         ` Volodymyr Babchuk
2017-06-19  9:37           ` George Dunlap
2017-06-19 17:54             ` Stefano Stabellini
2017-06-19 18:36               ` Volodymyr Babchuk
2017-06-20 10:11                 ` Dario Faggioli
2017-07-07 15:02                   ` Volodymyr Babchuk
2017-07-07 16:41                     ` Dario Faggioli
2017-07-07 17:03                       ` Volodymyr Babchuk
2017-07-07 21:12                         ` Stefano Stabellini
2017-07-12  6:14                           ` Dario Faggioli
2017-07-17  9:25                             ` George Dunlap
2017-07-17 10:04                               ` Julien Grall
2017-07-17 11:28                                 ` George Dunlap
2017-07-19 11:21                                   ` Julien Grall
2017-07-20  9:25                                     ` Dario Faggioli
2017-07-20  9:10                                   ` Dario Faggioli
2017-07-20  8:49                               ` Dario Faggioli
2017-07-08 14:26                         ` Dario Faggioli [this message]
2017-06-20 10:45                 ` Julien Grall
2017-06-20 16:23                   ` Volodymyr Babchuk
2017-06-21 10:38                     ` Julien Grall
2017-06-19 18:26             ` Volodymyr Babchuk
2017-06-20 10:00               ` Dario Faggioli
2017-06-20 10:30                 ` George Dunlap
2017-05-23  7:11   ` Dario Faggioli
2017-05-26 20:09     ` Volodymyr Babchuk
2017-05-27  2:10       ` Dario Faggioli
2017-05-23  9:08   ` George Dunlap
2017-05-26 19:43     ` Volodymyr Babchuk
2017-05-26 19:46       ` Volodymyr Babchuk

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=1499523960.3620.14.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=Artem_Mygaiev@epam.com \
    --cc=andrii_anisov@epam.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=vlad.babchuk@gmail.com \
    --cc=xen-devel@lists.xensource.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).