qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com,
	Cornelia Huck <cohuck@redhat.com>,
	kvm@vger.kernel.org, david@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 0/4] Balloon inhibit enhancements, vfio restriction
Date: Wed, 8 Aug 2018 00:58:32 +0300	[thread overview]
Message-ID: <20180808004929-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20180807135303.3938b3a2@t450s.home>

On Tue, Aug 07, 2018 at 01:53:03PM -0600, Alex Williamson wrote:
> On Tue, 7 Aug 2018 22:44:56 +0300
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Tue, Aug 07, 2018 at 01:31:21PM -0600, Alex Williamson wrote:
> > > v3:
> > >  - Drop "nested" term in commit log (David)
> > >  - Adopt suggested wording in ccw code (Cornelia)
> > >  - Explain balloon inhibitor usage in vfio common (Peter)
> > >  - Fix to call inhibitor prior to re-using existing containers
> > >    to avoid gap that pinning may have occurred in set container
> > >    ioctl (self) - Peter, this change is the reason I didn't
> > >    include your R-b.
> > >  - Add R-b to patches 1 & 2
> > > 
> > > v2:
> > >  - Use atomic ops for balloon inhibit counter (Peter)
> > >  - Allow endpoint driver opt-in for ballooning, vfio-ccw opt-in by
> > >    default, vfio-pci opt-in by device option, only allowed for mdev
> > >    devices, no support added for platform as there are no platform
> > >    mdev devices.
> > > 
> > > See patch 3/4 for detailed explanation why ballooning and device
> > > assignment typically don't mix.  If this eventually changes, flags
> > > on the iommu info struct or perhaps device info struct can inform
> > > us for automatic opt-in.  Thanks,
> > > 
> > > Alex  
> > 
> > One of the issues with pass-through is that it breaks overcommit
> > through swap. ballooning seems to offer one solution, instead of
> > making it work this patch just attempts to block ballooning.
> > 
> > I guess it's better than corrupting memory but I personally find this
> > approach disappointing.
> 
> Memory hotplug is the way to achieve variable density with assigned
> device VMs, otherwise look towards approaches like mdev and shared
> virtual addresses with PASID support.  We cannot shoehorn page faulting
> without both hardware and software support.  Some class of "legacy"
> device assignment will always have this incompatibility.  Thanks,
> 
> Alex

I'm not sure I agree.

At least with VTD, it seems entirely possible to change e.g. a PMD
atomically to point to a different set of PTEs, then flush.
That will allow removing memory at high granularity for
an arbitrary device without mdev or PASID dependency.

I suspect most IOMMUs are like this.

IIUC doing that within guest right now will cause a range to be unmapped
and them mapped again, which I suspect only works if we are lucky and
device does not access the range during this time.

So at some level it's a theoretical bug we would do well to fix,
and then we can support ballooning better.

-- 
MST

  reply	other threads:[~2018-08-07 21:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 19:31 [Qemu-devel] [PATCH v3 0/4] Balloon inhibit enhancements, vfio restriction Alex Williamson
2018-08-07 19:31 ` [Qemu-devel] [PATCH v3 1/4] balloon: Allow multiple inhibit users Alex Williamson
2018-08-07 19:44   ` Michael S. Tsirkin
2018-08-07 20:08     ` Alex Williamson
2018-08-08  0:07       ` Michael S. Tsirkin
2018-08-07 19:31 ` [Qemu-devel] [PATCH v3 2/4] kvm: Use inhibit to prevent ballooning without synchronous mmu Alex Williamson
2018-08-16 18:15   ` Alex Williamson
2018-08-17  7:46     ` Paolo Bonzini
2018-08-07 19:31 ` [Qemu-devel] [PATCH v3 3/4] vfio: Inhibit ballooning based on group attachment to a container Alex Williamson
2018-08-08  3:38   ` Peter Xu
2018-08-07 19:31 ` [Qemu-devel] [PATCH v3 4/4] vfio/ccw/pci: Allow devices to opt-in for ballooning Alex Williamson
2018-08-07 19:44 ` [Qemu-devel] [PATCH v3 0/4] Balloon inhibit enhancements, vfio restriction Michael S. Tsirkin
2018-08-07 19:53   ` Alex Williamson
2018-08-07 21:58     ` Michael S. Tsirkin [this message]
2018-08-07 22:40       ` Alex Williamson
2018-08-08  0:02         ` Michael S. Tsirkin
2018-08-08  3:45       ` Peter Xu
2018-08-08 22:23         ` Alex Williamson
2018-08-09  9:20           ` Michael S. Tsirkin
2018-08-09  9:23         ` Michael S. Tsirkin
2018-08-09  9:37           ` Peter Xu
2018-08-09 10:13             ` 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=20180808004929-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.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 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).