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: Mon, 10 Sep 2012 07:50:13 +0200 [thread overview]
Message-ID: <504D7F95.9070700@redhat.com> (raw)
In-Reply-To: <20120908222221.GA20588@redhat.com>
Il 09/09/2012 00:22, Michael S. Tsirkin ha scritto:
>> 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).
>
> There is no way in spec to break the guest.
> You can not fail to offer virtqueues.
You can always return 0 for the first queue.
> Besides, there is no guarantee that virtqueue setup
> happens after feature negotiation.
It is the only way that makes sense though (unless the guest would write
0 for its features). Should we change that?
>> 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.
>
> I think I get what your proposed SILENT means what I do not get
> is the motivation. It looks like a premature optimization to me.
The motivation is to let the driver choose between two behaviors: the
current one where ballooning is only done on request, and a more
aggressive one.
> The spec is pretty clear that if guest acks feature it
> is a contract that dictates behaviour.
> If it doesn't it is either ignored or just informative
> depending on feature.
>
>> 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.
>
> Block example is just informative. It does not need to be
> negotiated even to be used. But last example is wrong.
> If you ack GUEST_ANNOUNCE hypervisor assumes guest will
> announce self, if guest does not do it this break migration.
It is wrong indeed, sorry.
Better example: the driver can negotiate VIRTIO_NET_F_CTRL_RX and never
set promiscuous mode. The device has to obey if it does.
Similarly, if you set VIRTIO_BALLOON_F_SILENT_DEFLATE and only do chatty
deflate later, that's fine. If you do silent deflate, and the device
negotiated the feature, it has to work.
>> Delaying or avoiding is the same in the end. The spec says it well: "In
>> this case, deflation advice is merely a courtesy".
>
> So it looks like we don't need a new bit to leak in atomic ctx.
> Just do not ack MUST_TELL_HOST and delay telling host to a wq.
> IMO we should not add random stuff to spec like this just because it
> seems like a good idea.
But this way you have to choose all-or-none. If the host cannot do
silent deflate, you cannot balloon anymore, not even in the normal
"cooperative" mode.
> OK so TELL says *when* to notify host, SILENT if set allows guest
> to skip leak notifications? In this case TELL should just be ignored
> when SILENT is set.
Yeah, that was my first idea. However, there are existing drivers that
ignore SILENT, so that would not be 100% exact.
> IMHO, renaming is fine since there is confusion.
> But WILL_TELL is also not all that clear imho.
> I think the confusion is that TELL_HOST seems to
> imply we can avoid telling host at all.
> How about being explicit?
>
> VIRTIO_BALLOON_F_HOST_ACK_BEFORE_DEFLATE
Makes sense.
Paolo
next prev parent reply other threads:[~2012-09-10 5:50 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 7:46 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
2012-09-08 22:22 ` Michael S. Tsirkin
2012-09-10 5:50 ` Paolo Bonzini [this message]
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=504D7F95.9070700@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
Powered by JetHome