Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621774

Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue

From Peter Xu <peterx@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue
Date 2017-04-12 06:20 +0200
Message-ID <tvhV7-8fa-7@gated-at.bofh.it> (permalink)
References <tv9Ee-2L8-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 11, 2017 at 01:28:06PM -0600, Alex Williamson wrote:
> If the mmap_sem is contented then the vfio type1 IOMMU backend will
> defer locked page accounting updates to a workqueue task.  This has a
> few problems and depending on which side the user tries to play, they
> might be over-penalized for unmaps that haven't yet been accounted or
> race the workqueue to enter more mappings than they're allowed.  The
> original intent of this workqueue mechanism seems to be focused on
> reducing latency through the ioctl, but we cannot do so at the cost
> of correctness.  Remove this workqueue mechanism and update the
> callers to allow for failure.  We can also now recheck the limit under
> write lock to make sure we don't exceed it.
> 
> vfio_pin_pages_remote() also now necessarily includes an unwind path
> which we can jump to directly if the consecutive page pinning finds
> that we're exceeding the user's memory limits.  This avoids the
> current lazy approach which does accounting and mapping up to the
> fault, only to return an error on the next iteration to unwind the
> entire vfio_dma.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] vfio/type1: Remove locked page accounting workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-11 21:30 +0200
  Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue Peter Xu <peterx@redhat.com> - 2017-04-12 06:20 +0200
  Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue Auger Eric <eric.auger@redhat.com> - 2017-04-12 14:10 +0200
  Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue Kirti Wankhede <kwankhede@nvidia.com> - 2017-04-14 21:30 +0200
    Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-14 23:00 +0200
      Re: [PATCH v3] vfio/type1: Remove locked page accounting workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-15 00:10 +0200

csiph-web