From: Frediano Ziglio Subject: Re: [RFC PATCH] Start PV guest faster Date: Fri, 30 May 2014 09:37:43 +0100 Message-ID: <1401439063.22092.2.camel@hamster.uk.xensource.com> References: <1400570767.19478.16.camel@hamster.uk.xensource.com> <537B3CE40200007800013FB0@mail.emea.novell.com> <1401384264.19576.18.camel@hamster.uk.xensource.com> <5388394502000078000B5384@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WqIK9-0005yp-CC for xen-devel@lists.xenproject.org; Fri, 30 May 2014 08:38:01 +0000 In-Reply-To: <5388394502000078000B5384@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-05-30 at 07:54 +0100, Jan Beulich wrote: > >>> Frediano Ziglio 05/29/14 7:24 PM >>> > >On Tue, 2014-05-20 at 10:30 +0100, Jan Beulich wrote: > >> >>> On 20.05.14 at 09:26, wrote: > >> > It's a while I noticed that the time to start a large PV guest depends > >> > on the amount of memory. For VMs with 64 or more GB of ram the time can > >> > become quite significant (like 20 seconds). Digging around I found that > >> > a lot of time is spend populating RAM (from a single hypercall made by > >> > xenguest). > >> > >> Did you check whether - like noticed elsewhere - this is due to > >> excessive hypercall preemption/restart? I.e. whether making > >> the preemption checks less fine grained helps? > >> > > > >Yes, you are right! > > > >Sorry for late reply, I got some time only now. Doing some tests with a > >not so bug machine (3gb) and using strace to see amount of time spent > > > >| Xen preempt check | User allocation | Time all ioctls (sec) | > >| yes | single pages | 0.262 | > >| no | single pages | 0.0612 | > >| yes | bunk of pages | 0.0325 | > >| no | bunk of pages | 0.0280 | > > > >So yes, preemption check (I disable entirely for the tests!) is the main > >factor. Of course disabling entirely is not the right solution. Are > >there some way to understand how often to do, some sort of > >computation/timing? > > If you look at other instances, it's mostly heuristic at this point. I suppose > you'd want to make the preemption granularity slightly allocation order > dependent, e.g. preempt every 64 pages allocated (unless, of course, the > allocation order is even higher than that). > > Generally a time based approach (say every millisecond) might be > reasonable too, but reading out the time on each iteration isn't without > cost, so I'd recommend against this. > > Jan > I was thinking at some adaptive approach where at beginning you try to understand how much to wait. In the meantime I got results from my tests. See https://docs.google.com/spreadsheets/d/1u_93KXr1SGfn4Pz47tjPA71MMPnnQ4rTPF3SOANd_oY/edit?usp=sharing For the test I disabled entirely preemption. Frediano