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: Give back memory to dom0 after a fa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Give back memory to dom0 after a failed auto-balloon attempt.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 03:14:12 -0700
Delivery-date: Fri, 27 Jul 2007 03:12:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1184861749 -3600
# Node ID f85acff5bef548b934e3d8840a3eae01d2f38f7a
# Parent  3073f35ed58e5d39c8048363356e97be57235461
xend: Give back memory to dom0 after a failed auto-balloon attempt.
Signed-off-by: Frank van der Linden <frank.vanderlinden@xxxxxxx>
---
 tools/python/xen/xend/balloon.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -r 3073f35ed58e -r f85acff5bef5 tools/python/xen/xend/balloon.py
--- a/tools/python/xen/xend/balloon.py  Thu Jul 19 17:09:47 2007 +0100
+++ b/tools/python/xen/xend/balloon.py  Thu Jul 19 17:15:49 2007 +0100
@@ -94,7 +94,9 @@ def free(need_mem):
     # track the last used value so that we don't trigger too many watches.
 
     xoptions = XendOptions.instance()
+    dom0 = XendDomain.instance().privilegedDomain()
     xc = xen.lowlevel.xc.xc()
+    dom0_start_alloc_mb = get_dom0_current_alloc() / 1024
 
     try:
         dom0_min_mem = xoptions.get_dom0_min_mem() * 1024
@@ -133,7 +135,6 @@ def free(need_mem):
                         new_alloc_mb = new_alloc / 1024  # Round down
                         log.debug("Balloon: setting dom0 target to %d MiB.",
                                   new_alloc_mb)
-                        dom0 = XendDomain.instance().privilegedDomain()
                         dom0.setMemoryTarget(new_alloc_mb)
                         last_new_alloc = new_alloc
                 # Continue to retry, waiting for ballooning or scrubbing.
@@ -158,7 +159,10 @@ def free(need_mem):
                 (need_mem, dom0_min_mem, dom0_min_mem,
                  free_mem + scrub_mem + dom0_alloc - dom0_min_mem))
         else:
-            raise VmError('The privileged domain did not balloon!')
+            dom0.setMemoryTarget(dom0_start_alloc_mb)
+            raise VmError(
+                ('Not enough memory is available, and dom0 cannot'
+                 ' be shrunk any further'))
 
     finally:
         del xc

_______________________________________________
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: Give back memory to dom0 after a failed auto-balloon attempt., Xen patchbot-unstable <=