qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Rusty Russell <rusty@ozlabs.au.ibm.com>,
	Hollis Blanchard <hollisb@us.ibm.com>,
	kvm-devel <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [5874] Add virtio-balloon support
Date: Fri, 5 Dec 2008 14:14:37 +0000	[thread overview]
Message-ID: <200812051414.38406.paul@codesourcery.com> (raw)
In-Reply-To: <49385B02.9010206@codemonkey.ws>

On Thursday 04 December 2008, Anthony Liguori wrote:
> Hollis Blanchard wrote:
> > On Thu, 2008-12-04 at 20:33 +0000, Anthony Liguori wrote:
> >> +static void balloon_page(void *addr, int deflate)
> >> +{
> >> +#if defined(__linux__)
> >> +    if (!kvm_enabled() || kvm_has_sync_mmu())
> >> +        madvise(addr, TARGET_PAGE_SIZE,
> >> +                deflate ? MADV_WILLNEED : MADV_DONTNEED);
> >> +#endif
> >> +}
> >
> > Hmm, I just noticed this... we need to use VIRTIO_BALLOON_PFN_SHIFT like
> > Rusty did on the kernel side.
> >
> > However, in general I'm not sure how this is supposed to work. Isn't it
> > true that madvise() is a no-op if 0 < length < getpagesize()? If so, how
> > should the guest know the chunk size needed on the host?
>
> We need to pass multiple of TARGET_PAGE_SIZE to madvise()

You mean HOST_PAGE_SIZE?

My linux manpage says that the address must be page aligned.

Paul

  reply	other threads:[~2008-12-05 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 20:33 [Qemu-devel] [5874] Add virtio-balloon support Anthony Liguori
2008-12-04 21:34 ` Hollis Blanchard
2008-12-04 22:34   ` Anthony Liguori
2008-12-05 14:14     ` Paul Brook [this message]
2008-12-05 14:21       ` Anthony Liguori

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=200812051414.38406.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=hollisb@us.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@ozlabs.au.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).