On Thursday 05 April 2007, Dor Laor wrote: > >> >For example, lets says you are running several guests, and would > like > >> to > >> >start yet another one for a while - but have no free memory left. > >> > > >> > >> We have another solution for it that will soon be pushed into the > >> kernel: > >> It is the balloon driver solution. > >> Each guest runs a balloon driver, when the host needs to free up > memory > >> a daemon with certain policy asks some of the guests to inflate their > >> balloon, > >> KVM frees their ballooned pages and the host free memory increases. > >> When the memory pressure relives, the balloons get deflate command. > > > >You probably want to have a look at arch/s390/mm/cmm.c which is > >exactly doing what you want. Of course the message interface to the > >hypervisor is different to what you want to do. > > Gee, thanks, I wasn't aware of it. I wrote the Linux driver, not yet > ready for mainline. This might change things and I'll might use/change > the cmm. > It will take a while because my queue is jammed with too much stuff.
Another driver you might want to look at is the Xen balloon driver: http://81.161.245.2/lxr/http/source/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c The s390 driver is probably a better example though. One thing the Xen one got wrong is that its interface requires you do an hcall in order to get back a page that you gave up to the host. On s390, it simply maps the host empty_zero_page as COW into the guest like the initial memory, so you get a new page back with the regular method whenever you write to the guest real page. Arnd <>< ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel