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
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.

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, t

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

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 (an

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-17 Thread Anthony Liguori
Dor Laor wrote: > 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 cm

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

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

2008-01-17 Thread Anthony Liguori
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 >>> balloon driver should do the same - it seems to be the c

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

2008-01-17 Thread Dor Laor
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 > > balloon driver should do the same - it seems to be the correct tradeoff.

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

2008-01-17 Thread Martin Schwidefsky
On Thu, 2008-01-17 at 10:32 +0100, Christian Borntraeger wrote: > Am Donnerstag, 17. Januar 2008 schrieb Rusty Russell: > > 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.

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

2008-01-17 Thread Christian Borntraeger
Am Donnerstag, 17. Januar 2008 schrieb Rusty Russell: > 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. Yes, thats what we do in the s390 cmm driver. All in all the driver has

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

2008-01-16 Thread Rusty Russell
On Thursday 17 January 2008 15:01:46 Anthony Liguori wrote: > Rusty Russell wrote: > > OTOH it's currently pretty obvious (and usually fatal) if the guest has > > trouble meeting the balloon requirements. A serious host needs a way of > > detecting stress in the guest anyway, which this doesn't of

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, fix

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

2008-01-16 Thread Rusty Russell
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. > > + __free_page(page); > > + vb

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

[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, t