[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] add self-ballooning to balloon driver

  • To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.