Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
On Mon, Nov 11, 2019 at 04:06:45PM -0800, John Hubbard wrote: > As it says in the updated comment in gup.c: current FOLL_LONGTERM > behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the > FS DAX check requirement on vmas. > > However, the corresponding restriction in

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Jason Gunthorpe
On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > ... > > >> -} > > >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | > > >> FOLL_LONGTERM, > > >>

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 5:35 PM, Dan Williams wrote: > On Tue, Nov 12, 2019 at 5:08 PM John Hubbard wrote: >> >> On 11/12/19 4:58 PM, Dan Williams wrote: >> ... > It's not redundant relative to upstream which does not do anything the > FOLL_LONGTERM in the gup-slow path... but I have not looked at

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 5:08 PM John Hubbard wrote: > > On 11/12/19 4:58 PM, Dan Williams wrote: > ... > >>> It's not redundant relative to upstream which does not do anything the > >>> FOLL_LONGTERM in the gup-slow path... but I have not looked at patches > >>> 1-7 to see if something there made

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 4:58 PM, Dan Williams wrote: ... It's not redundant relative to upstream which does not do anything the FOLL_LONGTERM in the gup-slow path... but I have not looked at patches 1-7 to see if something there made it redundant. Oh, the hunk John had below for get_user_pages_remote()

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:43 PM Jason Gunthorpe wrote: > > On Tue, Nov 12, 2019 at 02:45:51PM -0800, Dan Williams wrote: > > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > > > > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > > > ... > > > >> -} > > > >> +ret =

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 3:14 PM, Dan Williams wrote: ... >> >> Is that OK, or did you want to go further (possibly in a follow-up >> patchset, as I'm hoping to get this one in soon)? > > That looks ok. Something to maybe push down into the core in a future Great! I'll post a cleaned up v4 (with the

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 2:45 PM, Dan Williams wrote: > On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: >> >> On 11/12/19 12:43 PM, Jason Gunthorpe wrote: >> ... -} +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, +page,

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 3:08 PM John Hubbard wrote: > > On 11/12/19 2:43 PM, Dan Williams wrote: > ... > > Ah, sorry. This was the first time I had looked at this series and > > jumped in without reading the background. > > > > Your patch as is looks ok, I assume you've removed the FOLL_LONGTERM

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 2:43 PM, Dan Williams wrote: ... > Ah, sorry. This was the first time I had looked at this series and > jumped in without reading the background. > > Your patch as is looks ok, I assume you've removed the FOLL_LONGTERM > warning in get_user_pages_remote in another patch? >

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > ... > >> -} > >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, > >> +page, vmas, NULL); > >> +/* > >> + * The

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Tue, Nov 12, 2019 at 2:24 PM John Hubbard wrote: > > On 11/12/19 1:57 PM, Dan Williams wrote: > ... > >> diff --git a/drivers/vfio/vfio_iommu_type1.c > >> b/drivers/vfio/vfio_iommu_type1.c > >> index d864277ea16f..017689b7c32b 100644 > >> --- a/drivers/vfio/vfio_iommu_type1.c > >> +++

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 12:43 PM, Jason Gunthorpe wrote: ... >> -} >> +ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, >> +page, vmas, NULL); >> +/* >> + * The lifetime of a vaddr_get_pfn() page pin is >> + *

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread John Hubbard
On 11/12/19 1:57 PM, Dan Williams wrote: ... >> diff --git a/drivers/vfio/vfio_iommu_type1.c >> b/drivers/vfio/vfio_iommu_type1.c >> index d864277ea16f..017689b7c32b 100644 >> --- a/drivers/vfio/vfio_iommu_type1.c >> +++ b/drivers/vfio/vfio_iommu_type1.c >> @@ -348,24 +348,20 @@ static int

Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-12 Thread Dan Williams
On Mon, Nov 11, 2019 at 4:07 PM John Hubbard wrote: > > As it says in the updated comment in gup.c: current FOLL_LONGTERM > behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the > FS DAX check requirement on vmas. > > However, the corresponding restriction in get_user_pages_remote()