virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: fes@google.com, aarcange@redhat.com, riel@redhat.com,
	yvugenfi@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, mikew@google.com,
	yinghan@google.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works
Date: Fri, 07 Sep 2012 16:44:40 +0200	[thread overview]
Message-ID: <504A0858.4080508@redhat.com> (raw)
In-Reply-To: <20120907142545.GC17397@redhat.com>

Il 07/09/2012 16:25, Michael S. Tsirkin ha scritto:
>> > Silent deflate is deflating just by using the page, without using the
>> > deflateq at all.  So it can be done even from GFP_ATOMIC context.
> BTW I don't see a need to avoid deflateq.
> Without MUST_TELL_HOST you can just deflate and then
> bounce telling the host out to a thread.

Yes, that's fine too.

>> > But knowing that the guest will _not_ deflate silently also benefits the
>> > host. This is the cause of unpinning ballooned pages and pinning them
>> > again upon deflation. This allows cooperative memory overcommit even if
>> > the guests' memory is pinned, similar to what Xen did before it
>> > supported overcommit.  This is the second feature bit.
> This is the MUST_TELL_HOST.

Almost.  One is "the guest, if really needed, can tell the host of
pages".  If not negotiated, and the host does not support it, the host
must break the guest (e.g. fail to offer any virtqueues).

The other is "the guest, though, would prefer not to do so".  It is
different because the guest can proceed in a fallback mode even if the
host doesn't offer it.

You're interpreting features as something that dictates behavior, but
they're really just advisory.  You could negotiate VIRTIO_BLK_F_TOPOLOGY
and end up never reading the fields; you could negotiate
VIRTIO_NET_F_GUEST_ANNOUNCE and never send a guest announcement.

>> > * guest will always do silent deflation: current Windows driver.
> Not exactly. It is not silent. It tells host
> just after use.

Yeah, but no difference from the POV of the driver.

Delaying or avoiding is the same in the end.  The spec says it well: "In
this case, deflation advice is merely a courtesy".

>> > Negotiates nothing, or if it cares it can negotiate
>> > VIRTIO_BALLOON_F_SILENT_DEFLATE.  Host mustn't do munlock/mlock dance.
>> >
>> > * guest may do silent deflation if available: combo of Linux driver +
>> > Frank's driver.  Negotiates both features, looks at
>> > VIRTIO_BALLOON_F_SILENT_DEFLATE host feature to decide how to behave:
>> > 
>> >   ** If PCI passthrough, the host will not negotiate
>> >      VIRTIO_BALLOON_F_SILENT_DEFLATE.  The driver will behave as the
>> >      current Linux driver, the host can do the munlock/mlock dance.
> So this case is just existing interface. OK.
> 
>> >   ** If no PCI passthrough, the host will negotiate
>> >      VIRTIO_BALLOON_F_SILENT_DEFLATE, and the driver can balloon more
>> >      aggressively and not use the deflateq.
>> > 
> This last trickery confuses me.  It just does not make sense to set both
> SILENT and TELL: either you are silent or you tell.

"I can be chatty if you ask me, but I'd rather be silent if you let me".

TELL is a request of the host to the guest; the guest can agree or not.

SILENT is a request of the guest to the host; the host can agree or not.

> What is the benefit of avoiding host notification?
> It seems cleaner for the host to know the state.

Yeah, if you want to do it you can.

Paolo

  reply	other threads:[~2012-09-07 14:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06  7:46 [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works Paolo Bonzini
2012-09-06  8:47 ` Michael S. Tsirkin
2012-09-06  9:24   ` Paolo Bonzini
2012-09-06  9:44     ` Michael S. Tsirkin
2012-09-06  9:57       ` Paolo Bonzini
2012-09-06 10:53         ` Michael S. Tsirkin
2012-09-06 12:13           ` Paolo Bonzini
2012-09-06 12:51             ` Michael S. Tsirkin
2012-09-06 13:12               ` Paolo Bonzini
2012-09-06 23:45             ` Rusty Russell
2012-09-07  5:42               ` Michael S. Tsirkin
2012-09-07  6:39                 ` Rusty Russell
2012-09-07  9:27                   ` Paolo Bonzini
2012-09-07 10:53                     ` Michael S. Tsirkin
2012-09-07 11:20                       ` Paolo Bonzini
2012-09-07 12:17                         ` Michael S. Tsirkin
2012-09-07 12:22                           ` Paolo Bonzini
2012-09-07 12:44                             ` Michael S. Tsirkin
2012-09-07 14:04                               ` Paolo Bonzini
2012-09-07 14:25                                 ` Michael S. Tsirkin
2012-09-07 14:44                                   ` Paolo Bonzini [this message]
2012-09-08 22:22                                     ` Michael S. Tsirkin
2012-09-10  5:50                                       ` Paolo Bonzini
     [not found]                                       ` <504D7F95.9070700@redhat.com>
2012-09-10  6:03                                         ` Michael S. Tsirkin
2012-09-10  6:38                                           ` Paolo Bonzini
2012-09-10  6:47                                             ` Michael S. Tsirkin
2012-09-10  6:55                                               ` Paolo Bonzini
2012-09-07 10:43                   ` Michael S. Tsirkin
2012-09-08  5:06                     ` Rusty Russell
2012-09-08 10:32                       ` Paolo Bonzini
2012-09-08 22:37                       ` Michael S. Tsirkin
2012-09-10  1:43                         ` Rusty Russell
2012-09-10  5:51                           ` Paolo Bonzini
2012-09-10  5:51                           ` Michael S. Tsirkin
2012-09-12  6:24                             ` Rusty Russell
2012-09-06 23:41 ` Michael S. Tsirkin

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=504A0858.4080508@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=fes@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikew@google.com \
    --cc=mst@redhat.com \
    --cc=riel@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=yinghan@google.com \
    --cc=yvugenfi@redhat.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).