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-devel

Re: [Xen-devel] [PATCH] reserve vtd_mem on guest restore

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] reserve vtd_mem on guest restore
From: Miroslav Rezanina <mrezanin@xxxxxxxxxx>
Date: Thu, 2 Sep 2010 12:23:30 -0400 (EDT)
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 02 Sep 2010 09:24:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <364688843.1952251283444477164.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
----- "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx> wrote:

> From: "Ian Jackson" <Ian.Jackson@xxxxxxxxxxxxx>
> To: "Miroslav Rezanina" <mrezanin@xxxxxxxxxx>
> Cc: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, September 2, 2010 6:06:15 PM GMT +01:00 Amsterdam / Berlin / 
> Bern / Rome / Stockholm / Vienna
> Subject: Re: [Xen-devel] [PATCH] reserve vtd_mem on guest restore
>
> Miroslav Rezanina writes ("[Xen-devel] [PATCH] 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.
> 
> This patch has a syntax error:
> 
>     File "tools/python/xen/xend/XendCheckpoint.py", line 280
>       vtd_mem = 0
>       ^
>   IndentationError: unexpected indent
> 
> Ian.

Oh, you're right..I do not know how I could miss it - now I see it even in mail.
Indentation problem cause by different level in XendDomainInfo.py.

Correct version is:
--
diff -r 9f49667fec71 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Fri Jul 30 15:22:39 2010 +0100
+++ b/tools/python/xen/xend/XendCheckpoint.py   Thu Sep 02 18:21:35 2010 +0200
@@ -277,7 +277,15 @@
         # 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
-- 
Miroslav Rezanina
Software Engineer - Virtualization Team - XEN kernel


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

<Prev in Thread] Current Thread [Next in Thread>