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] add self-ballooning to balloon driver

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] add self-ballooning to balloon driver
From: "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 24 Apr 2008 16:47:35 -0600
Delivery-date: Thu, 24 Apr 2008 15:49:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Oracle Corporation
Reply-to: "dan.magenheimer@xxxxxxxxxx" <dan.magenheimer@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcimXS7v87vIDBw/SQ6+dCmEfXDRxg==
The attached patch adds a "self-ballooning" feature to the balloon
driver.  Currently it only works when the balloon driver is
compiled into the kernel (e.g. not as a pv-on-hvm driver) because,
alas, the key kernel global variable is not exported.

It can be turned on with "echo 1 > /proc/xen/balloon" and
off again with "echo 0 > /proc/xen/balloon".  It defaults off.

I've tested it with a program that randomly eats memory and it
seems to work pretty well balancing two domains and surrendering
lots of memory (but not too much) when a domain is idle.  The
only deleterious effect I've seen is that performance suffers
for a second or so when a big memory app is launched on a
previously ballooned-down system (due to swapping).  But this
is a small price to pay in some real world environments.

It obviously shouldn't be used on a domain that doesn't have
a (virtual) swap disk configured.  If you foresee other issues,
please let me know.

I've got lots of ideas for building on this (for example rate-limiting
memory surrendering) but thought I'd submit the basic patch
for others to try/test.


If Xen could save time in a bottle / then clocks wouldn't virtually skew /
It would save every tick / for VMs that aren't quick /
and Xen then would send them anew
(with apologies to the late great Jim Croce)

Attachment: selfballoon.patch
Description: Binary data

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] add self-ballooning to balloon driver, Dan Magenheimer <=