linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	fes@google.com, aarcange@redhat.com, riel@redhat.com,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	mikew@google.com, yinghan@google.com,
	virtualization@lists.linux-foundation.org, yvugenfi@redhat.com,
	vrozenfe@redhat.com
Subject: Re: [PATCH] virtio-balloon spec: provide a version of the "silent deflate" feature that works
Date: Mon, 10 Sep 2012 11:13:12 +0930	[thread overview]
Message-ID: <87fw6qfya7.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20120908223724.GB20588@redhat.com>

"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Sat, Sep 08, 2012 at 02:36:00PM +0930, Rusty Russell wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> > On Fri, Sep 07, 2012 at 04:09:50PM +0930, Rusty Russell wrote:
>> >> > So it looks like a bug: we should teach driver to tell host first on leak?
>> >> > Yan, Vadim, can you comment please?
>> >> >
>> >> > Also if true, looks like this bit will be useful to detect a fixed driver on
>> >> > the hypervisor side - to avoid unmapping such pages? Rusty what do you
>> >> > think?
>> >> 
>> >> So, feature is unimplemented in qemu, and broken in drivers.  I starting
>> >> to share Paolo's dislike of it.
>> >
>> > What is broken in drivers?
>> 
>> Because supporting the feature is *not* optional for a driver.
>> 
>> If the device said MUST_TELL_HOST, it meant that the driver *had* to
>> tell the host before it touched the page, otherwise Bad Things might
>> happen.  It was in the original spec precisely to allow devices to
>> actually *remove* pages.
>> 
>> Noone ever noticed the windows driver didn't support it, because qemu
>> never requires MUST_TELL_HOST.
>> 
>> So in practice, it's now an optional feature.  Since no device used it
>> anyway, we're better off discarding it than trying to fix it.
>
> I trust you this was not the intent. But it seems to be
> the intent in spec, because almost all features are optional.
>
> And so windows driver authors interpreted it
> this way. And it is *useful* like this.  See below.

...

> Suggested use is for device assignment which needs all guest memory
> locked.  hypervisor can unlock pages in balloon but guest must wait for
> hypervisor to lock them back before use.
>
> when a hypervisor implements this,
> this will work with linux guests but not windows
> guests and the existing bit fits exactly the purpose.

If a hypervisor needs this, and the guest doesn't support it, then
the hypervisor can only abandon the balloon device.  That's not my
definition of "optional".

>> > Do we really know there are no hypervisors implementing it?
>> 
>> As much as can be known.  Qemu doesn't, lkvm doesn't.
>
> But we can add it in qemu and it will be a useful feature.
>
>> > As I said above drivers do have support.
>> 
>> Not the windows drivers.  So it's optional, thus removing it will likely
>> harm noone.
>> 
>> Cheers,
>> Rusty.
>
> I think the issue is that kvm always locked all guest memory
> for assignment. This restriction is removed
> with vfio which has separate page tables.
> Now that vfio is upstream and work on qemu integration
> is being worked on, we might finally see people using this bit
> to allow memory overcommit with device assignment.

That was left-field.... so you're saying some guest might pull a page
from the balloon and DMA to it, and the vfio device needs to know in
advance that it's going to do it?

But what will we do if the guest doesn't ack the bit?

ie. I don't think it can really be optional.

Cheers,
Rusty.

  reply	other threads:[~2012-09-10  2:31 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
2012-09-08 22:22                                     ` Michael S. Tsirkin
2012-09-10  5:50                                       ` Paolo Bonzini
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 [this message]
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=87fw6qfya7.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --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=pbonzini@redhat.com \
    --cc=riel@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vrozenfe@redhat.com \
    --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).