public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/balloon: Set balloon's initial state to number of existing RAM pages
@ 2013-11-06 20:37 Boris Ostrovsky
  2013-11-06 21:29 ` Konrad Rzeszutek Wilk
  2013-11-07  0:41 ` [Xen-devel] " Bob Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2013-11-06 20:37 UTC (permalink / raw)
  To: konrad.wilk, david.vrabel; +Cc: xen-devel, linux-kernel, boris.ostrovsky

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>
---
 drivers/xen/balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index b232908..1b62304 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -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;
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-07 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 20:37 [PATCH] xen/balloon: Set balloon's initial state to number of existing RAM pages Boris Ostrovsky
2013-11-06 21:29 ` Konrad Rzeszutek Wilk
2013-11-07  0:41 ` [Xen-devel] " Bob Liu
2013-11-07  1:25   ` Konrad Rzeszutek Wilk
2013-11-07 14:38     ` Daniel Kiper
2013-11-07 17:37       ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox