public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <marcelo@kvack.org>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [PATCH] virtio-balloon: do not attempt to release more	than available pages
Date: Wed, 05 Mar 2008 18:59:10 +0200	[thread overview]
Message-ID: <47CED15E.4090504@qumranet.com> (raw)
In-Reply-To: <20080305162832.GA11563@dmt>

Marcelo Tosatti wrote:
> Handle the case where the balloon target is larger than total ram size.
>
> BUG: unable to handle kernel paging request at 0000000000100100
> IP: [<ffffffff881970f9>] :virtio_balloon:leak__balloon+0x2e/0xbe
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: virtio/virtio_balloon.c
> ===================================================================
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -122,10 +122,21 @@ static void release_pages_by_pfn(const u
>  	}
>  }
>  
> +static void update_target_size(struct virtio_balloon *vb)
> +{
> +	__le32 num_pages = cpu_to_le32(vb->num_pages);
> +
> +	vb->vdev->config->set(vb->vdev,
> +			      offsetof(struct virtio_balloon_config, num_pages),
> +			      &num_pages, sizeof(num_pages));
> +}
>   

The target is host-owned; moreover the problem may be temporary, but 
you've changed the target permanently.

Suggest sending the host a message (like the page list) indicating it 
couldn't allocate any more.

Also, we may have driven the guest close to oom with this.  We need to 
notify the host when the guest gets into a low-memory cannot swap condition.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-03-05 16:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 16:28 [PATCH] virtio-balloon: do not attempt to release more than available pages Marcelo Tosatti
2008-03-05 16:59 ` Avi Kivity [this message]
2008-03-05 18:12   ` Marcelo Tosatti
2008-03-05 18:13     ` Avi Kivity
2008-03-05 18:43     ` Anthony Liguori
2008-03-05 19:39       ` Marcelo Tosatti
2008-03-05 19:42         ` Anthony Liguori
2008-03-06  7:06           ` Avi Kivity
2008-03-05 18:42   ` Anthony Liguori
2008-03-05 22:39 ` Rusty Russell
2008-03-08 19:06   ` Marcelo Tosatti
2008-03-11  0:26     ` Rusty Russell
2008-03-11  0:52       ` Anthony Liguori
2008-03-11 11:54         ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CED15E.4090504@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=marcelo@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox