From: "Jan Beulich" Subject: Re: [RFC PATCH] Start PV guest faster Date: Fri, 30 May 2014 07:54:45 +0100 Message-ID: <5388394502000078000B5384@mail.emea.novell.com> References: <1400570767.19478.16.camel@hamster.uk.xensource.com> <537B3CE40200007800013FB0@mail.emea.novell.com> <1401384264.19576.18.camel@hamster.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WqGiH-0003j9-8N for xen-devel@lists.xenproject.org; Fri, 30 May 2014 06:54:49 +0000 In-Reply-To: <1401384264.19576.18.camel@hamster.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: frediano.ziglio@citrix.com 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 >>> 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