aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/xen/setup.c7
-rw-r--r--drivers/xen/balloon.c4
-rw-r--r--include/xen/page.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 46d6d21dbdbe..c983717c018c 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -39,6 +39,9 @@ extern void xen_syscall32_target(void);
39/* Amount of extra memory space we add to the e820 ranges */ 39/* Amount of extra memory space we add to the e820 ranges */
40phys_addr_t xen_extra_mem_start, xen_extra_mem_size; 40phys_addr_t xen_extra_mem_start, xen_extra_mem_size;
41 41
42/* Number of pages released from the initial allocation. */
43unsigned long xen_released_pages;
44
42/* 45/*
43 * The maximum amount of extra memory compared to the base size. The 46 * The maximum amount of extra memory compared to the base size. The
44 * main scaling factor is the size of struct page. At extreme ratios 47 * main scaling factor is the size of struct page. At extreme ratios
@@ -313,7 +316,9 @@ char * __init xen_memory_setup(void)
313 extra_pages = 0; 316 extra_pages = 0;
314 } 317 }
315 318
316 extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); 319 xen_released_pages = xen_return_unused_memory(xen_start_info->nr_pages,
320 &e820);
321 extra_pages += xen_released_pages;
317 322
318 /* 323 /*
319 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO 324 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 5dfd8f8ff07f..4f59fb373381 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -565,7 +565,9 @@ static int __init balloon_init(void)
565 565
566 pr_info("xen/balloon: Initialising balloon driver.\n"); 566 pr_info("xen/balloon: Initialising balloon driver.\n");
567 567
568 balloon_stats.current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn) : max_pfn; 568 balloon_stats.current_pages = xen_pv_domain()
569 ? min(xen_start_info->nr_pages - xen_released_pages, max_pfn)
570 : max_pfn;
569 balloon_stats.target_pages = balloon_stats.current_pages; 571 balloon_stats.target_pages = balloon_stats.current_pages;
570 balloon_stats.balloon_low = 0; 572 balloon_stats.balloon_low = 0;
571 balloon_stats.balloon_high = 0; 573 balloon_stats.balloon_high = 0;
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 @@
5 5
6extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; 6extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size;
7 7
8extern unsigned long xen_released_pages;
9
8#endif /* _XEN_PAGE_H */ 10#endif /* _XEN_PAGE_H */