qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] balloon driver


From: Eric L
Subject: Re: [Qemu-devel] balloon driver
Date: Sat, 8 Jul 2006 20:06:38 -0500

On 7/5/06, Paul Brook <address@hidden> wrote:
On Wednesday 05 July 2006 03:58, Eric L wrote:
> I've been playing around with QEMU the past few days and have been
> quite impressed.  One thing I wondered about: it seems that most of
> the other virtualization schemes have some sort of balloon driver to
> reclaim unused (cached) guest memory.  (VMWare, Xen and I think user
> mode linux has something too).  It seems like a pretty good idea to
> me, but from my searching, it would appear that QEMU does not have
> anything similar.  Is this correct?  If so, is there a reason why?

Partly because qemu is just a normal user application. It can be swapped out
by the host OS just like any other process. Adding a few Gb of extra swap and
letting the host OS figure it out should get you 90% of the benefit.

Paul


It seems the point of the balloon driver is to avoid forcing the host
to swap.  For example, suppose I start a new guest OS.  I check the
memory usage on the host and everything looks pretty good, maybe 30MB
used.  Then suppose I run a recursive grep command in a Linux source
tree on the guest.  The host memory usage will climb to the maximum
allotted memory as the guest OS fills its page cache with pages of
kernel source.  Now, I go back to the host and decide I want to run
something a little memory intensive.  The host has to swap and
dutifully copies those pages of kernel source to swap.  Much better
would be if I could just chuck those pages and give them back to the
host, no swapping at all.

Even if the guest has to swap, the reasoning is that the guest is in a
much better position to figure out what to swap than if the host were
forced to.

It is a rather crude approach and I'm not sure how much practical
benefit there is, but I'll probably go ahead and code it up (at least
for a Linux host) if only for myself as it looks pretty simple.
(Linux 2.6.16 added the ability to punch holes in tmpfs files so all
the hard work should be done).  I just wondered if there was anything
I was missing or if anyone had considered it before.


- E




reply via email to

[Prev in Thread] Current Thread [Next in Thread]