From: Wei Wang <wei.w.wang@intel.com>
To: Tyler Sanderson <tysand@google.com>,
virtualization@lists.linux-foundation.org, mst@redhat.com
Subject: Re: VIRTIO_BALLOON_F_FREE_PAGE_HINT
Date: Mon, 16 Sep 2019 09:41:42 +0800 [thread overview]
Message-ID: <5D7EE856.2080602@intel.com> (raw)
In-Reply-To: <CAJuQAmpQmNN1EJHm4RinZnBven9Bx4GGqd-8Mt+L=3Z-3pd+zg@mail.gmail.com>
On 09/14/2019 02:36 AM, Tyler Sanderson wrote:
> Hello, I'm curious about the intent of VIRTIO_BALLOON_F_FREE_PAGE_HINT
> (commit
> <https://github.com/torvalds/linux/commit/86a559787e6f5cf662c081363f64a20cad654195#diff-fd202acf694d9eba19c8c64da3e480c9>).
>
>
> My understanding is that this mechanism works similarly to the
> existing inflate/deflate queues. Pages are allocated by the guest and
> then reported on VQ_FREE_PAGE.
>
> Question: Is there a limit to how many pages will be allocated? What
> controls the amount of memory pressure applied?
No control for the limit currently. The implementation reports all the
guest free pages to host.
The main usage for this feature so far is to have guest skip sending
those guest free pages
(the more, the better) during live migration.
>
> In my experience with virtio balloon there are problems with the
> mechanisms that are supposed to deflate the balloon in response to
> memory pressure (e.g. OOM notifier).
What problem did you see? We've also changed balloon to use memory shrinker,
did you see the problem with shrinker as well?
>
> It seems an ideal balloon interface would allow the guest to round
> robin through free guest physical pages, allowing the host to unback
> them, but never having more than a few pages allocated to the balloon
> at any one time. For example:
> 1. Guest allocates 1 page and notifies balloon device of this page's
> address.
> 2. Host debacks the received page.
> 3. Guest frees the page.
> 4. Repeat at #1, but ensure that different pages are allocated each time.
Probably you need a mechanism to "ensure" different pages to be allocated.
The current implementation (having balloon hold the allocated pages) could
be thought of as one mechanism (it is simple).
>
> This way the "balloon size" is never more than a few pages and does
> not create memory pressure. However the difficulty is in ensuring each
> set of sent pages is disjoint from previously sent pages. Is there a
> mechanism to round-robin allocations through all of guest physical
> memory? Does VIRTIO_BALLOON_F_FREE_PAGE_HINT enable this?
>
AFAIK, no such round-robin allocation so far. This may need the page
allocation to have states recording
the allocation history.
Best,
Wei
next parent reply other threads:[~2019-09-16 1:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAJuQAmpQmNN1EJHm4RinZnBven9Bx4GGqd-8Mt+L=3Z-3pd+zg@mail.gmail.com>
2019-09-16 1:41 ` Wei Wang [this message]
2019-09-16 7:26 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT David Hildenbrand
[not found] ` <CAJuQAmpQV26kb9vTyoW-Q7PsD0SOfX+otkiQZAks1L6k7rgdig@mail.gmail.com>
2019-10-03 18:31 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT Michael S. Tsirkin
[not found] ` <CAJuQAmrCiPsofYpDvm8=i32d9c9yCmKpJRBSRFkeubP_2=XKtw@mail.gmail.com>
2019-10-04 8:06 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT David Hildenbrand
2019-10-04 8:35 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT Michael S. Tsirkin
2019-10-04 8:56 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT David Hildenbrand
[not found] ` <CAJuQAmpwQ4guGtHTTWC60EAYBuJ264d6CgWmWEHSnb8-CRtWBw@mail.gmail.com>
2019-10-05 21:03 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT Michael S. Tsirkin
2019-10-06 8:30 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT David Hildenbrand
2019-10-06 11:48 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT Michael S. Tsirkin
2019-10-06 21:42 ` VIRTIO_BALLOON_F_FREE_PAGE_HINT Tyler Sanderson via Virtualization
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=5D7EE856.2080602@intel.com \
--to=wei.w.wang@intel.com \
--cc=mst@redhat.com \
--cc=tysand@google.com \
--cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.