From aa24411b6717fd1e6ecef281bec497f6f30bbd66 Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Wed, 28 Sep 2011 17:46:32 +0100 Subject: xen/balloon: account for pages released during memory setup In xen_memory_setup() pages that occur in gaps in the memory map are released back to Xen. This reduces the domain's current page count in the hypervisor. The Xen balloon driver does not correctly decrease its initial current_pages count to reflect this. If 'delta' pages are released and the target is adjusted the resulting reservation is always 'delta' less than the requested target. This affects dom0 if the initial allocation of pages overlaps the PCI memory region but won't affect most domU guests that have been setup with pseudo-physical memory maps that don't have gaps. Fix this by accouting for the released pages when starting the balloon driver. If the domain's targets are managed by xapi, the domain may eventually run out of memory and die because xapi currently gets its target calculations wrong and whenever it is restarted it always reduces the target by 'delta'. Signed-off-by: David Vrabel Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/page.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/xen/page.h') diff --git a/include/xen/page.h b/include/xen/page.h index 0be36b976f4b..92b61f8c772c 100644 --- a/include/xen/page.h +++ b/include/xen/page.h @@ -5,4 +5,6 @@ extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; +extern unsigned long xen_released_pages; + #endif /* _XEN_PAGE_H */ -- cgit v1.2.3-59-g8ed1b