Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 17:38:22 +0000 (UTC)
From:      Roger Pau Monné <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272320 - head/sys/dev/xen/balloon
Message-ID:  <201409301738.s8UHcMmB017352@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409301738.s8UHcMmB017352>