Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver
From: Anthony Liguori <hidden>
Date: 2008-01-20 00:40:36
Marcelo Tosatti wrote:
On Sat, Jan 19, 2008 at 04:37:43PM -0600, Anthony Liguori wrote:quoted
Avi Kivity wrote:quoted
Rusty Russell wrote:quoted
After discussions with Anthony Liguori, it seems that the virtio balloon can be made even simpler. Here's my attempt. Since the balloon requires Guest cooperation anyway, there seems little reason to force it to tell the Host when it wants to reuse a page. It can simply fault it in.Faulting is synchronous, while deflating is (or can be made) asynchronous. If the host needs to do some work to get the memory, the guest will be slowed down considerably.Good point. Basically, we have two page hinting operations which roughly correspond to madvise(MADV_DONTNEED) and madvise(MADV_WILLNEED).Also, the simplified driver does not handle errors at all. I don't think that assuming madvise() can't fail is a good thing.
I don't think the host should be communicating to the guest if madvise() fails. The notification is a hint to the host. The guest doesn't know what the host is doing in response to that hint. Regards, Anthony Liguori