Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-07 Thread Mike Rapoport
On Tue, Nov 05, 2019 at 11:00:06AM -0800, John Hubbard wrote: > On 11/5/19 5:10 AM, Mike Rapoport wrote: > ... > >> --- > >> Documentation/vm/index.rst | 1 + > >> Documentation/vm/pin_user_pages.rst | 212 ++ > > > > I think it belongs to Documentation/core-api. >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-06 Thread Ira Weiny
> > > ... > >> +This document describes the following functions: :: > >> + > >> + pin_user_pages > >> + pin_user_pages_fast > >> + pin_user_pages_remote > >> + > >> + pin_longterm_pages > >> + pin_longterm_pages_fast > >> + pin_longterm_pages_remote > >> + > >> +Basic description of FOLL_PIN >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-05 Thread John Hubbard
On 11/5/19 5:10 AM, Mike Rapoport wrote: ... >> --- >> Documentation/vm/index.rst | 1 + >> Documentation/vm/pin_user_pages.rst | 212 ++ > > I think it belongs to Documentation/core-api. Done: diff --git a/Documentation/core-api/index.rst

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-05 Thread Mike Rapoport
On Sun, Nov 03, 2019 at 01:18:00PM -0800, John Hubbard wrote: > Introduce pin_user_pages*() variations of get_user_pages*() calls, > and also pin_longterm_pages*() variations. > > These variants all set FOLL_PIN, which is also introduced, and > thoroughly documented. > > The pin_longterm*()

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
On 11/4/19 1:15 PM, Jason Gunthorpe wrote: ... >> Right, and I thought about this when converting, and realized that the above >> code is working around the current gup.c limitations, which are "cannot >> support >> gup remote with FOLL_LONGTERM". > > But AFAICT it doesn't have a problem, the

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 12:57:59PM -0800, John Hubbard wrote: > On 11/4/19 12:37 PM, Jason Gunthorpe wrote: > > On Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: > >>> Note for Jason: the (a) or (b) items are talking about the vfio case, > >>> which is > >>> one of the two call sites

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
On 11/4/19 12:37 PM, Jason Gunthorpe wrote: > On Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: >>> Note for Jason: the (a) or (b) items are talking about the vfio case, which >>> is >>> one of the two call sites that now use pin_longterm_pages_remote(), and the >>> other one is

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 12:33:09PM -0800, David Rientjes wrote: > > > On Sun, 3 Nov 2019, John Hubbard wrote: > > > Introduce pin_user_pages*() variations of get_user_pages*() calls, > > and also pin_longterm_pages*() variations. > > > > These variants all set FOLL_PIN, which is also

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
On 11/4/19 12:31 PM, Jason Gunthorpe wrote: > On Mon, Nov 04, 2019 at 12:09:05PM -0800, John Hubbard wrote: > >> Note for Jason: the (a) or (b) items are talking about the vfio case, which >> is >> one of the two call sites that now use pin_longterm_pages_remote(), and the >> other one is

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: > > Note for Jason: the (a) or (b) items are talking about the vfio case, which > > is > > one of the two call sites that now use pin_longterm_pages_remote(), and the > > other one is infiniband: > > > >

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 12:09:05PM -0800, John Hubbard wrote: > Jason, a question for you at the bottom. > > On 11/4/19 11:52 AM, Jerome Glisse wrote: > ... > >> CASE 3: ODP > >> --- > >> RDMA hardware with page faulting support. Here, a well-written driver > >> doesn't > > > > CASE3:

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jason Gunthorpe
On Mon, Nov 04, 2019 at 12:09:05PM -0800, John Hubbard wrote: > Note for Jason: the (a) or (b) items are talking about the vfio case, which is > one of the two call sites that now use pin_longterm_pages_remote(), and the > other one is infiniband: > > drivers/infiniband/core/umem_odp.c:646:

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
Jason, a question for you at the bottom. On 11/4/19 11:52 AM, Jerome Glisse wrote: ... >> CASE 3: ODP >> --- >> RDMA hardware with page faulting support. Here, a well-written driver doesn't > > CASE3: Hardware with page fault support > --- > > Here, a

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 11:30:32AM -0800, John Hubbard wrote: > On 11/4/19 11:18 AM, Jerome Glisse wrote: > > On Mon, Nov 04, 2019 at 11:04:38AM -0800, John Hubbard wrote: > >> On 11/4/19 9:33 AM, Jerome Glisse wrote: > >> ... > >>> > >>> Few nitpick belows, nonetheless: > >>> > >>> Reviewed-by:

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
On 11/4/19 11:18 AM, Jerome Glisse wrote: > On Mon, Nov 04, 2019 at 11:04:38AM -0800, John Hubbard wrote: >> On 11/4/19 9:33 AM, Jerome Glisse wrote: >> ... >>> >>> Few nitpick belows, nonetheless: >>> >>> Reviewed-by: Jérôme Glisse >>> [...] + +CASE 3: ODP +---

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Mon, Nov 04, 2019 at 11:04:38AM -0800, John Hubbard wrote: > On 11/4/19 9:33 AM, Jerome Glisse wrote: > ... > > > > Few nitpick belows, nonetheless: > > > > Reviewed-by: Jérôme Glisse > > [...] > >> + > >> +CASE 3: ODP > >> +--- > >> +(Mellanox/Infiniband On Demand Paging: the

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread John Hubbard
On 11/4/19 9:33 AM, Jerome Glisse wrote: ... > > Few nitpick belows, nonetheless: > > Reviewed-by: Jérôme Glisse > [...] >> + >> +CASE 3: ODP >> +--- >> +(Mellanox/Infiniband On Demand Paging: the hardware supports >> +replayable page faulting). There are GUP references to pages serving

Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-04 Thread Jerome Glisse
On Sun, Nov 03, 2019 at 01:18:00PM -0800, John Hubbard wrote: > Introduce pin_user_pages*() variations of get_user_pages*() calls, > and also pin_longterm_pages*() variations. > > These variants all set FOLL_PIN, which is also introduced, and > thoroughly documented. > > The pin_longterm*()