]> git.karo-electronics.de Git - linux-beck.git/commitdiff
xen/balloon: Set balloon's initial state to number of existing RAM pages
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 6 Nov 2013 20:37:40 +0000 (15:37 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 8 Nov 2013 20:13:03 +0000 (15:13 -0500)
Currently balloon's initial value is set to max_pfn which includes
non-RAM ranges such as MMIO hole. As result, initial memory target
(specified by guest's configuration file) will appear smaller than
what balloon driver perceives to be the current number of available
pages. Thus it will balloon down "extra" pages, decreasing amount of
available memory for no good reason.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/balloon.c

index b232908a61925724bb61bc0f8a09ecbca6b753e6..1b62304197044dc5b5690a97e5491cf2d83d8af0 100644 (file)
@@ -641,7 +641,7 @@ static int __init balloon_init(void)
 
        balloon_stats.current_pages = xen_pv_domain()
                ? min(xen_start_info->nr_pages - xen_released_pages, max_pfn)
-               : max_pfn;
+               : get_num_physpages();
        balloon_stats.target_pages  = balloon_stats.current_pages;
        balloon_stats.balloon_low   = 0;
        balloon_stats.balloon_high  = 0;