ia64/xen-unstable

changeset 12198:09aa7ed2431f

[XEND] Be more generous with the default shadow allocation.
Allow enough shadow memory to avoid thrashing the shadow pages,
rather than just enough for safety.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Wed Oct 25 11:44:58 2006 +0100 (2006-10-25)
parents f61dcd518cd6
children 59ac1e90f1ac
files tools/python/xen/xend/image.py
line diff
     1.1 --- a/tools/python/xen/xend/image.py	Wed Oct 25 10:27:03 2006 +0100
     1.2 +++ b/tools/python/xen/xend/image.py	Wed Oct 25 11:44:58 2006 +0100
     1.3 @@ -500,9 +500,12 @@ class X86_HVM_ImageHandler(HVMImageHandl
     1.4          # overhead due to getRequiredInitialReservation.
     1.5          maxmem_kb = self.getRequiredInitialReservation(maxmem_kb)
     1.6  
     1.7 -        # 1MB per vcpu plus 4Kib/Mib of RAM.  This is higher than 
     1.8 -        # the minimum that Xen would allocate if no value were given.
     1.9 -        return max(1024 * self.vm.getVCpuCount() + maxmem_kb / 256,
    1.10 +        # 256 pages (1MB) per vcpu,
    1.11 +        # plus 1 page per MiB of RAM for the P2M map,
    1.12 +        # plus 1 page per MiB of RAM to shadow the resident processes.  
    1.13 +        # This is higher than the minimum that Xen would allocate if no value 
    1.14 +        # were given (but the Xen minimum is for safety, not performance).
    1.15 +        return max(4 * (256 * self.vm.getVCpuCount() + 2 * (maxmem_kb / 1024)),
    1.16                     shadow_mem_kb)
    1.17  
    1.18