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


Groups > linux.kernel > #1624761

Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external()

From Alex Williamson <alex.williamson@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external()
Date 2017-04-17 19:30 +0200
Message-ID <txiDn-3sK-3@gated-at.bofh.it> (permalink)
References <tx3XH-2FQ-3@gated-at.bofh.it> <tx3XH-2FQ-5@gated-at.bofh.it> <tx8NI-5UK-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 17 Apr 2017 14:54:21 +0800
Peter Xu <peterx@redhat.com> wrote:

> On Sun, Apr 16, 2017 at 07:42:39PM -0600, Alex Williamson wrote:
> > With vfio_lock_acct() testing the locked memory limit under mmap_sem,
> > it's redundant to do it here for a single page.  We can also reorder
> > our tests such that we can avoid testing for reserved pages if we're
> > not doing accounting, and test the process CAP_IPC_LOCK only if we
> > are doing accounting.  Finally, this function oddly returns 1 on
> > success.  Update to return zero on success, -errno on error.  Since
> > the function only pins a single page, there's no need to return the
> > number of pages pinned.
> > 
> > N.B. vfio_pin_pages_remote() can pin a large contiguous range of pages
> > before calling vfio_lock_acct().  If we were to similarly remove the
> > extra test there, a user could temporarily pin far more pages than
> > they're allowed.
> > 
> > Suggested-by: Kirti Wankhede <kwankhede@nvidia.com>
> > Suggested-by: Peter Xu <peterx@redhat.com>  
> 
> Maybe this suggested-by honor should be for Kirti only? :)

Sorry, I mis-attributed this, Eric suggested that
vfio_pin_page_external() should have a standard return value.  I'll
change the Suggested-by.
 
> For the patch, I think it's good to me as long as we have the
> accounting check in vfio_lock_acct() which is just introduced in
> previous patch, so:
> 
> Reviewed-by: Peter Xu <peterx@redhat.com>

Thanks!

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


Thread

[PATCH v4 0/2] vfio/type1: Synchronous locked page accounting Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 03:50 +0200
  [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external() Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 03:50 +0200
    Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external() Peter Xu <peterx@redhat.com> - 2017-04-17 09:00 +0200
      Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external() Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 19:30 +0200
    Re: [PATCH v4 2/2] vfio/type1: Prune vfio_pin_page_external() Kirti Wankhede <kwankhede@nvidia.com> - 2017-04-17 21:20 +0200
  [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 03:50 +0200
    Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Peter Xu <peterx@redhat.com> - 2017-04-17 08:50 +0200
      Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 16:40 +0200
        Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Kirti Wankhede <kwankhede@nvidia.com> - 2017-04-17 21:10 +0200
          Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 21:30 +0200
            Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Kirti Wankhede <kwankhede@nvidia.com> - 2017-04-17 21:40 +0200
              Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Alex Williamson <alex.williamson@redhat.com> - 2017-04-17 23:40 +0200
                Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Peter Xu <peterx@redhat.com> - 2017-04-18 05:00 +0200
                Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting  workqueue Kirti Wankhede <kwankhede@nvidia.com> - 2017-04-18 20:30 +0200

csiph-web