Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-23 Thread Rusty Russell
Here's the latest. Hope this works for everyone (putting in a oom handler or shrinker requires a lock, but can be done quite easily). Untested. === After discussions with Anthony Liguori, it seems that the virtio balloon can be made even simpler. Here's my attempt. Signed-off-by: Rusty Russell

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-19 Thread Anthony Liguori
Avi Kivity wrote: Rusty Russell wrote: 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

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-19 Thread Marcelo Tosatti
On Sat, Jan 19, 2008 at 04:37:43PM -0600, Anthony Liguori wrote: Avi Kivity wrote: Rusty Russell wrote: 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

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-19 Thread Anthony Liguori
Marcelo Tosatti wrote: On Sat, Jan 19, 2008 at 04:37:43PM -0600, Anthony Liguori wrote: Avi Kivity wrote: Rusty Russell wrote: After discussions with Anthony Liguori, it seems that the virtio balloon can be made even simpler. Here's my attempt. Since the balloon requires

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-18 Thread Avi Kivity
Rusty Russell wrote: 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

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-18 Thread Avi Kivity
Anthony Liguori wrote: It would be very useful too to write vb-num_pages into the config space whenever it was updated. This way, the host can easily keep track of where the guest is at in terms of ballooning. OTOH it's currently pretty obvious (and usually fatal) if

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-17 Thread Dor Laor
On Thu, 2008-01-17 at 07:56 -0600, Anthony Liguori wrote: Dor Laor wrote: On Thu, 2008-01-17 at 11:25 +0100, Martin Schwidefsky wrote: Another idea: Martin added an oom notifier to the cmm driver. Before the oom-killer kicks in cmm will try to free 256 pages. I think your virtio

[kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-16 Thread Rusty Russell
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. Moreover,

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-16 Thread Anthony Liguori
Rusty Russell wrote: 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

Re: [kvm-devel] [PATCH] KVM simplified virtio balloon driver

2008-01-16 Thread Anthony Liguori
Rusty Russell wrote: On Thursday 17 January 2008 13:14:58 Anthony Liguori wrote: Rusty Russell wrote: +static struct virtio_device_id id_table[] = { + { VIRTIO_ID_BALLOON, VIRTIO_DEV_ANY_ID}, Could use a space after VIRTIO_DEV_ANY_ID Thanks, fixed. +