Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Ira Weiny
On Mon, Feb 11, 2019 at 04:25:10PM -0700, Jason Gunthorpe wrote: > On Mon, Feb 11, 2019 at 02:55:10PM -0800, Dan Williams wrote: > > > > I also wonder if someone should think about making fast into a flag > > > too.. > > > > > > But I'm not sure when fast should be used vs when it shouldn't :( > >

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Jason Gunthorpe
On Mon, Feb 11, 2019 at 02:55:10PM -0800, Dan Williams wrote: > > I also wonder if someone should think about making fast into a flag > > too.. > > > > But I'm not sure when fast should be used vs when it shouldn't :( > > Effectively fast should always be used just in case the user cares > about

RE: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Weiny, Ira
> > On Mon, Feb 11, 2019 at 2:07 PM Jason Gunthorpe wrote: > > > > On Mon, Feb 11, 2019 at 01:52:38PM -0800, Ira Weiny wrote: > > > On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: > > > > On 2/11/19 1:26 PM, Ira Weiny wrote: > > > > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John H

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Dan Williams
On Mon, Feb 11, 2019 at 2:07 PM Jason Gunthorpe wrote: > > On Mon, Feb 11, 2019 at 01:52:38PM -0800, Ira Weiny wrote: > > On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: > > > On 2/11/19 1:26 PM, Ira Weiny wrote: > > > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: >

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Jason Gunthorpe
On Mon, Feb 11, 2019 at 01:52:38PM -0800, Ira Weiny wrote: > On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: > > On 2/11/19 1:26 PM, Ira Weiny wrote: > > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: > > >> On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > > >>> On Mon,

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread John Hubbard
On 2/11/19 1:52 PM, Ira Weiny wrote: > On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: >> On 2/11/19 1:26 PM, Ira Weiny wrote: >>> On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > On Mon, Feb 11, 2019 at 12:16:42PM -0

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Ira Weiny
On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: > On 2/11/19 1:26 PM, Ira Weiny wrote: > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: > >> On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > >>> On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: > F

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Dan Williams
On Mon, Feb 11, 2019 at 1:39 PM John Hubbard wrote: > > On 2/11/19 1:26 PM, Ira Weiny wrote: > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: > >> On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > >>> On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: > From: Ir

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread John Hubbard
On 2/11/19 1:26 PM, Ira Weiny wrote: > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: >> On 2/11/19 12:39 PM, Jason Gunthorpe wrote: >>> On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: From: Ira Weiny >> [...] >> It seems to me that the longterm vs. short-t

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Ira Weiny
On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: > On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > > On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: > >> From: Ira Weiny > [...] > >> +static inline int get_user_pages_fast_longterm(unsigned long start, int > >> nr_p

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread John Hubbard
On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: >> From: Ira Weiny [...] >> +static inline int get_user_pages_fast_longterm(unsigned long start, int >> nr_pages, >> + bool write, struct pa

Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread Jason Gunthorpe
On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.we...@intel.com wrote: > From: Ira Weiny > > Users of get_user_pages_fast are not protected against mapping > pages within FS DAX. Introduce a call which protects them. > > We do this by checking for DEVMAP pages during the fast walk and > falling b

[PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm()

2019-02-11 Thread ira . weiny
From: Ira Weiny Users of get_user_pages_fast are not protected against mapping pages within FS DAX. Introduce a call which protects them. We do this by checking for DEVMAP pages during the fast walk and falling back to the longterm gup call to check for FS DAX if needed. Signed-off-by: Ira Wei