WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] what happens when a PoD page is touched?

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
Subject: RE: [Xen-devel] what happens when a PoD page is touched?
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Mon, 16 May 2011 19:17:10 +1000
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, xen devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 16 May 2011 02:18:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110516083905.GP24068@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AEC6C66638C05B468B556EA548C1A77D01D57078@trantor> <20110516083905.GP24068@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwTpMydkt1EYLMiT5OZlmTHKaTrHwABB03Q
Thread-topic: [Xen-devel] what happens when a PoD page is touched?
> 
> At 11:16 +0100 on 15 May (1305458171), James Harper wrote:
> > I'm finding that the time of boot and hibernation of Windows under
> > xen-4.0.2-rc3 when maxmem is set is a big problem - 40 seconds to
> > balloon down 512MB on my system. Hibernation is even worse with
delays
> > of minutes or hours.
> >
> > What happens when such a PoD page is touched? Does Xen or qemu
handle
> > this?
> 
> Xen handles it.  When you touch a PoD page the frame is backed with a
> fresh, zeroed page from the pool of PoD pages.  The slowdown comes
when
> the PoD pages run low; then Xen has to scan guest memory looking for
> pages that are all zeroes and reclaim them into the PoD pool.
> 
> This is all pretty unpleasant, as you can imagine.  The practical
> advice is:
> 
> - get your balloon driver loaded as soon as you possibly can,
>   so you can balloon down before the Windows page scrubber pointlessly
>   touches all of RAM (AIUI on SMP systems this is pretty hard; it may
be
>   that once we get UEFI firmware it will be eaiser);

Doing that pretty successfully. The only slowdown is when I balloon down
and have to zero the pages first (see below)

> - alloc pages to be ballooned using an interface that doesn't scrub
them;

That exists under Windows 2003 and newer (MmAllocatePagesForMdlEx with
the MM_DONT_ZERO_ALLOCATION flag), but not before that. But I thought
the pages had to be zeroed by us anyway as part of the contract? I tried
testing each page before freeing and the first 90% or so are already all
zeroes but the last few % of pages aren't necessarily.

> - don't be too aggressive about how much you overcommit.

:)

> Ideally, once Hyper-V brings in an interface for dynamic memory
> ballooning in guests, we can use that and avoid this whole rigmarole
for
> new windows version.
> 
> CC'ing George, who knows this code best.  IIRC there were some tweaks
to
> this code for XenServer, which I hope are all now upstream.  Do you
know
> whether 4.1-testing has the full set or are they only in -unstable?
> 

Is the delay only the first time a page is touched? If I allocate 1MB
worth of pages (I'm ballooning up/down in 1MB increments) and Windows
goes through and zero's the lot, will the sweep be invoked every time a
new page is hit (potentially just reusing one of the previously zeroed
pages)?

Thanks

James


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel