|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: revisit the super page support in HVM restore
On 19/08/2009 08:55, "Zhai, Edwin" <edwin.zhai@xxxxxxxxx> wrote:
>> You wil fail to restore a guest which has ballooned down its memory as there
>> will be 4k holes in its memory map.
>
> I see. But current PV guest has same issue also. If set superpages for
> the PV guest, allocate_mfn in xc_domain_restore.c would try to allocate
> 2M page for each of pfn regardless of the holes. Per my understanding,
> this is more serious issue for PV guest, as it uses balloon driver more
> frequently.
I don't think this has been addressed yet for PV guests. But then again
noone much is using the PV superpage support. Whereas this HVM superpage
logic will be always on. So it needs to work reliably!
> If we have to use this algorithm, back to my complicated code -- do you
> have any suggestion to simplify the logic?
I wasn't clear where your pseudocode fits into xc_domain_restore. My view is
that we would probably stuff the logic inside allocate_physmem(), or near
the call to allocate_physmem(). The logic added would look for start of a
superpage, and look for a straight run of pages to the end of the superpage
(or until we hit the end of the batch, which would need special treatment).
As for other points:
* "Need tell if it's a super page or not" -- superpages in the guest
physmap are only an optimisation. We can introduce them where possible,
regardless of which regions were or weren't superpage-backed in the original
source domain.
* "Need know if page has already been populated, and if populated as a
normal page or superpage" -- p2m[] array tells us what is already populated.
And we do not need care after the allocation has happened whether it was a
superpage or not: a superpage will simply fill 512 entries in the p2m[]. Our
try-to-allocate-superpage logic will simply bail if it detects any entry in
the p2m[] range of interest is already populated.
Basically all we need is a "good-enough" heuristic for allocating
superpages, as they are an optimisation only. If measurement tells us our
heuristic is failing too often, then we can get more
sophisticated/complicated.
-- Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|