Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Ira Weiny
On Mon, Mar 25, 2019 at 03:36:28PM -0700, Dan Williams wrote: > On Mon, Mar 25, 2019 at 3:22 PM Ira Weiny wrote: > [..] > > FWIW this thread is making me think my original patch which simply > > implemented > > get_user_pages_fast_longterm() would be more clear. There is some evidence > > that t

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Dan Williams
On Mon, Mar 25, 2019 at 3:22 PM Ira Weiny wrote: [..] > FWIW this thread is making me think my original patch which simply implemented > get_user_pages_fast_longterm() would be more clear. There is some evidence > that the GUP API was trending that way (see get_user_pages_remote). That > seems

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Ira Weiny
On Mon, Mar 25, 2019 at 02:51:50PM -0300, Jason Gunthorpe wrote: > On Mon, Mar 25, 2019 at 02:23:15AM -0700, Ira Weiny wrote: > > > > Unfortunately holding the lock is required to support FOLL_LONGTERM (to > > > > check > > > > the VMAs) but we don't want to hold the lock to be optimal > > > > (s

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Jason Gunthorpe
On Mon, Mar 25, 2019 at 02:23:15AM -0700, Ira Weiny wrote: > > > Unfortunately holding the lock is required to support FOLL_LONGTERM (to > > > check > > > the VMAs) but we don't want to hold the lock to be optimal (specifically > > > allow > > > FAULT_FOLL_ALLOW_RETRY). So I'm maintaining the op

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Ira Weiny
On Mon, Mar 25, 2019 at 01:47:13PM -0300, Jason Gunthorpe wrote: > On Mon, Mar 25, 2019 at 01:42:26AM -0700, Ira Weiny wrote: > > On Fri, Mar 22, 2019 at 03:12:55PM -0700, Dan Williams wrote: > > > On Sun, Mar 17, 2019 at 7:36 PM wrote: > > > > > > > > From: Ira Weiny > > > > > > > > DAX pages we

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Jason Gunthorpe
On Mon, Mar 25, 2019 at 01:42:26AM -0700, Ira Weiny wrote: > On Fri, Mar 22, 2019 at 03:12:55PM -0700, Dan Williams wrote: > > On Sun, Mar 17, 2019 at 7:36 PM wrote: > > > > > > From: Ira Weiny > > > > > > DAX pages were previously unprotected from longterm pins when users > > > called get_user_p

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-25 Thread Ira Weiny
On Fri, Mar 22, 2019 at 03:12:55PM -0700, Dan Williams wrote: > On Sun, Mar 17, 2019 at 7:36 PM wrote: > > > > From: Ira Weiny > > > > DAX pages were previously unprotected from longterm pins when users > > called get_user_pages_fast(). > > > > Use the new FOLL_LONGTERM flag to check for DEVMAP p

Re: [RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-22 Thread Dan Williams
On Sun, Mar 17, 2019 at 7:36 PM wrote: > > From: Ira Weiny > > DAX pages were previously unprotected from longterm pins when users > called get_user_pages_fast(). > > Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall > back to regular GUP processing if a DEVMAP page is encountered

[RESEND 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-03-17 Thread ira . weiny
From: Ira Weiny DAX pages were previously unprotected from longterm pins when users called get_user_pages_fast(). Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall back to regular GUP processing if a DEVMAP page is encountered. Signed-off-by: Ira Weiny --- mm/gup.c | 29 ++