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 memory ballooning: do not bother if

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend memory ballooning: do not bother if guest will not fit in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Sep 2007 03:41:33 -0700
Delivery-date: Wed, 26 Sep 2007 04:28:11 -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 Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1190709000 -3600
# Node ID 55c45361bbe32d3046e1245415dded998ce057e4
# Parent  ad339d88639d56f08546ba0dab55b2c717b4d60b
xend memory ballooning: do not bother if guest will not fit in
physical memory constraints.

If users require domain memory size larger than a physical memory
size, we do not need waiting for ballooning, and should cause
xm create command error right away.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/balloon.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

diff -r ad339d88639d -r 55c45361bbe3 tools/python/xen/xend/balloon.py
--- a/tools/python/xen/xend/balloon.py  Mon Sep 24 21:52:10 2007 +0100
+++ b/tools/python/xen/xend/balloon.py  Tue Sep 25 09:30:00 2007 +0100
@@ -100,12 +100,28 @@ def free(need_mem):
 
     try:
         dom0_min_mem = xoptions.get_dom0_min_mem() * 1024
+        dom0_alloc = get_dom0_current_alloc()
 
         retries = 0
         sleep_time = SLEEP_TIME_GROWTH
+        new_alloc = 0
         last_new_alloc = None
         last_free = None
         rlimit = RETRY_LIMIT
+
+        # If unreasonable memory size is required, we give up waiting
+        # for ballooning or scrubbing, as if had retried.
+        physinfo = xc.physinfo()
+        free_mem = physinfo['free_memory']
+        scrub_mem = physinfo['scrub_memory']
+        total_mem = physinfo['total_memory']
+        if dom0_min_mem > 0:
+            max_free_mem = total_mem - dom0_min_mem
+        else:
+            max_free_mem = total_mem - dom0_alloc
+        if need_mem >= max_free_mem:
+            retries = rlimit
+
         while retries < rlimit:
             physinfo = xc.physinfo()
             free_mem = physinfo['free_memory']

_______________________________________________
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 memory ballooning: do not bother if guest will not fit in, Xen patchbot-unstable <=