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

[Xen-devel] [PATCH] Allow max_pages to be set to less than tot_pages

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Allow max_pages to be set to less than tot_pages
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Thu, 21 Oct 2010 16:19:14 +0100
Delivery-date: Thu, 21 Oct 2010 08:20:09 -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: Mutt/1.5.18 (2008-05-17)
The memory allocation code sometimes needs to enforce that a guest
that's been told to balloon down isn't going to expand further (because
it's still executing a previous balloon-up operation).  That means being
able to set the desired max_pages even before the balloon driver has
brought tot_pages down to the right level.

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>

diff -r 95226c6fe89b xen/common/domctl.c
--- a/xen/common/domctl.c       Mon Jun 01 11:31:38 2009 +0100
+++ b/xen/common/domctl.c       Mon Jun 01 15:41:41 2009 +0100
@@ -675,11 +675,11 @@
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
 
         spin_lock(&d->page_alloc_lock);
-        if ( new_max >= d->tot_pages )
-        {
-            d->max_pages = new_max;
-            ret = 0;
-        }
+        /* N.B. We removed a check that new_max >= current tot_pages;
+         * this means the domain will "ratchet" down to new_max.
+         * In the meantime tot will be > max. */
+        d->max_pages = new_max;
+        ret = 0;
         spin_unlock(&d->page_alloc_lock);
 
     max_mem_out:


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

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