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/
Home Products Support Community News


[Xen-devel] [PATCH] Domain creation 4MB memory allocation

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Domain creation 4MB memory allocation
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Wed, 01 Apr 2009 09:49:53 +0200
Delivery-date: Wed, 01 Apr 2009 00:50:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
User-agent: Thunderbird (X11/20090320)
I've found some problems when running 2 guests with and then trying to install a new machine (no matter whether using virt-manager or virt-install). I am attaching a patch that fixes this problem.

I was working on 8G box and I have done those things:
1. xm create PVguest maxmem=2500 memory=2500
2. xm create FVguest maxmem=2500 memory=2500
3. virt-install -l http://path/to/install/ -r 2500 -v --nodisks -n someGuestName

Before applying this patch it returned "Cannot allocate memory" error but after applying my patch it created a new domain and started installation well but it's reproducible sometimes and not everytime.

Best regards,

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>
diff -r d5ddc782bc49 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 30 16:48:26 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 01 09:43:37 2009 +0200
@@ -2245,8 +2245,9 @@
         # There is an implicit memory overhead for any domain creation. This
         # overhead is greater for some types of domain than others. For
         # example, an x86 HVM domain will have a default shadow-pagetable
-        # allocation of 1MB. We free up 2MB here to be on the safe side.
-        balloon.free(2*1024, self) # 2MB should be plenty
+        # allocation of 1MB. We free up 4MB here to be on the safe side.
+        # 2MB memory allocation was not enough in some cases, so it's 4MB now
+        balloon.free(4*1024, self) # 4MB should be plenty
         ssidref = 0
         if security.on() == xsconstants.XS_POLICY_USE:
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>