WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: reserve vtd_mem on guest restore

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: reserve vtd_mem on guest restore
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Sep 2010 14:40:12 -0700
Delivery-date: Fri, 10 Sep 2010 14:40:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Miroslav Rezanina <mrezanin@xxxxxxxxxx>
# Date 1283534551 -3600
# Node ID 4e98698360910f68571a8d82b06681aa5c06d96c
# Parent  1831912d4109731e78c01be40ec70b5fae804d30
xend: reserve vtd_mem on guest restore

There's need for free vtd_mem more memory for guest with
xen-unstable c/s 17529.  This memory is freed when guest is
created, but is not freed when guest is restored. So restore
guest fails due  to not enough of memory for guest.

Following patch uses same calculation of memory to free in guest
restore as is in guest creation.

Signed-off-by: Miroslav Rezanina <mrezanin@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendCheckpoint.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 1831912d4109 -r 4e9869836091 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Thu Sep 02 19:12:42 2010 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py   Fri Sep 03 18:22:31 2010 +0100
@@ -277,7 +277,15 @@ def restore(xd, fd, dominfo = None, paus
         # set memory limit
         xc.domain_setmaxmem(dominfo.getDomid(), maxmem)
 
-        balloon.free(memory + shadow, dominfo)
+        vtd_mem = 0
+        info = xc.physinfo()
+        if 'hvm_directio' in info['virt_caps']:
+            # Reserve 1 page per MiB of RAM for separate VT-d page table.
+            vtd_mem = 4 * (dominfo.info['memory_static_max'] / 1024 / 1024)
+            # Round vtd_mem up to a multiple of a MiB.
+            vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
+
+        balloon.free(memory + shadow + vtd_mem, dominfo)
 
         shadow_cur = xc.shadow_mem_control(dominfo.getDomid(), shadow / 1024)
         dominfo.info['shadow_memory'] = shadow_cur

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: reserve vtd_mem on guest restore, Xen patchbot-unstable <=