Dan Magenheimer
2008-Apr-24 22:47 UTC
[Xen-devel] [PATCH] add self-ballooning to balloon driver
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. Dan ==================================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) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel