svn commit: r272320 - head/sys/dev/xen/balloon

Roger Pau Monné royger at FreeBSD.org
Tue Sep 30 17:38:22 UTC 2014


Author: royger
Date: Tue Sep 30 17:38:21 2014
New Revision: 272320
URL: http://svnweb.freebsd.org/changeset/base/272320

Log:
  xen/balloon: fix accounting of current memory pages on PVH
  
  Using realmem on PVH is not realiable, since in this case the realmem value
  is computed from Maxmem, which contains the higher memory address found. Use
  HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and
  contains the exact number of memory pages assigned to the domain.
  
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/balloon/balloon.c

Modified: head/sys/dev/xen/balloon/balloon.c
==============================================================================
--- head/sys/dev/xen/balloon/balloon.c	Tue Sep 30 17:37:26 2014	(r272319)
+++ head/sys/dev/xen/balloon/balloon.c	Tue Sep 30 17:38:21 2014	(r272320)
@@ -405,7 +405,8 @@ xenballoon_attach(device_t dev)
 #ifndef XENHVM
 	bs.current_pages = min(xen_start_info->nr_pages, max_pfn);
 #else
-	bs.current_pages = realmem;
+	bs.current_pages = xen_pv_domain() ?
+	    HYPERVISOR_start_info->nr_pages : realmem;
 #endif
 	bs.target_pages  = bs.current_pages;
 	bs.balloon_low   = 0;


More information about the svn-src-all mailing list