Make ballooning work with maxmem > mem
PATCH 1/1 Make ballooning work with maxmem > mem
Trying to start a guest with maxmem > mem and then balloon up to a value greater than mem is currently failing.
This patch fixes it.
Signature · 3 lines
Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom"
# HG changeset patch
# User [email protected]
# Date 1163006677 18000
# Node ID 8347687597a4da4ed323e58e640da89b25bb2c49 # Parent 20204db0891b0b7c10959822e3283656c3600500 [LINUX] Extend physical mapping to maxmem instead of mem
As currently physical mapping only reaches the initial reservation, we're unable to balloon up to more than mem (even when maxmem > mem) in any situation.
Signed-off-by Glauber de Oliveira Costa <[email protected]>
linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c +6 -1
@@ -583,6 +583,7 @@ void __init setup_memory_region(void)* the boot process we know we have plenty slack space. */ struct e820entry map[E820MAX ]; +unsigned long arg =DOMID_SELF ; memmap.nr_entries =E820MAX ;set_xen_guest_handle (memmap.buffer, map);
@@ -591,7 +592,11 @@ void __init setup_memory_region(void)if ( rc == -ENOSYS ) { memmap.nr_entries =1 ; map[0 ].addr =0ULL ; - map[0 ].size = xen_start_info->nr_pages <<PAGE_SHIFT ; + rc =HYPERVISOR_memory_op (XENMEM_maximum_reservation, &arg); +if ( rc <0 ) + map[0 ].size = xen_start_info->nr_pages <<PAGE_SHIFT ; +else + map[0 ].size = rc <<PAGE_SHIFT ;/* 8MB slack (to balance backend allocations). */ map[0 ].size +=8 <<20 ; map[0 ].type =E820_RAM ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel