Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-03 Thread John Hubbard
On 10/3/18 9:27 AM, Jan Kara wrote: > On Fri 28-09-18 20:12:33, John Hubbard wrote: >> static inline void release_user_pages(struct page **pages, >> - unsigned long npages) >> + unsigned long npages, >> +

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-03 Thread John Hubbard
On 10/3/18 9:27 AM, Jan Kara wrote: > On Fri 28-09-18 20:12:33, John Hubbard wrote: >> static inline void release_user_pages(struct page **pages, >> - unsigned long npages) >> + unsigned long npages, >> +

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-03 Thread Jan Kara
On Fri 28-09-18 20:12:33, John Hubbard wrote: > static inline void release_user_pages(struct page **pages, > - unsigned long npages) > + unsigned long npages, > + bool set_dirty) > { > -

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-03 Thread Jan Kara
On Fri 28-09-18 20:12:33, John Hubbard wrote: > static inline void release_user_pages(struct page **pages, > - unsigned long npages) > + unsigned long npages, > + bool set_dirty) > { > -

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-02 Thread John Hubbard
On 10/1/18 7:35 AM, Dennis Dalessandro wrote: > On 9/28/2018 11:12 PM, John Hubbard wrote: >> On 9/28/18 8:39 AM, Jason Gunthorpe wrote: >>> On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: From: John Hubbard >> [...] diff --git

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-02 Thread John Hubbard
On 10/1/18 7:35 AM, Dennis Dalessandro wrote: > On 9/28/2018 11:12 PM, John Hubbard wrote: >> On 9/28/18 8:39 AM, Jason Gunthorpe wrote: >>> On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: From: John Hubbard >> [...] diff --git

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Christoph Hellwig
On Mon, Oct 01, 2018 at 08:29:29AM -0700, Matthew Wilcox wrote: > I don't understand the dislike of the sg list. Other than for special > cases which we should't be optimising for (ramfs, brd, loopback > filesystems), when we get a page to do I/O, we're going to want a dma > mapping for them. It

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Christoph Hellwig
On Mon, Oct 01, 2018 at 08:29:29AM -0700, Matthew Wilcox wrote: > I don't understand the dislike of the sg list. Other than for special > cases which we should't be optimising for (ramfs, brd, loopback > filesystems), when we get a page to do I/O, we're going to want a dma > mapping for them. It

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Matthew Wilcox
On Mon, Oct 01, 2018 at 05:50:13AM -0700, Christoph Hellwig wrote: > On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > > > being slow to pick it up. It looks like there are several patterns, and > > > we have to support both set_page_dirty() and set_page_dirty_lock(). So > > > the

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Matthew Wilcox
On Mon, Oct 01, 2018 at 05:50:13AM -0700, Christoph Hellwig wrote: > On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > > > being slow to pick it up. It looks like there are several patterns, and > > > we have to support both set_page_dirty() and set_page_dirty_lock(). So > > > the

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Dennis Dalessandro
On 9/28/2018 11:12 PM, John Hubbard wrote: On 9/28/18 8:39 AM, Jason Gunthorpe wrote: On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: From: John Hubbard [...] diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Dennis Dalessandro
On 9/28/2018 11:12 PM, John Hubbard wrote: On 9/28/18 8:39 AM, Jason Gunthorpe wrote: On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: From: John Hubbard [...] diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Christoph Hellwig
On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > > being slow to pick it up. It looks like there are several patterns, and > > we have to support both set_page_dirty() and set_page_dirty_lock(). So > > the best combination looks to be adding a few variations of > >

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-10-01 Thread Christoph Hellwig
On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > > being slow to pick it up. It looks like there are several patterns, and > > we have to support both set_page_dirty() and set_page_dirty_lock(). So > > the best combination looks to be adding a few variations of > >

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-29 Thread Jason Gunthorpe
On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > On Fri, Sep 28, 2018 at 08:12:33PM -0700, John Hubbard wrote: > > >> +++ b/drivers/infiniband/core/umem.c > > >> @@ -60,7 +60,7 @@ static void __ib_umem_release(struct ib_device *dev, > > >> struct ib_umem *umem, int d > > >>

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-29 Thread Jason Gunthorpe
On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > On Fri, Sep 28, 2018 at 08:12:33PM -0700, John Hubbard wrote: > > >> +++ b/drivers/infiniband/core/umem.c > > >> @@ -60,7 +60,7 @@ static void __ib_umem_release(struct ib_device *dev, > > >> struct ib_umem *umem, int d > > >>

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-29 Thread Matthew Wilcox
On Fri, Sep 28, 2018 at 08:12:33PM -0700, John Hubbard wrote: > >> +++ b/drivers/infiniband/core/umem.c > >> @@ -60,7 +60,7 @@ static void __ib_umem_release(struct ib_device *dev, > >> struct ib_umem *umem, int d > >>page = sg_page(sg); > >>if (!PageDirty(page) &&

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-29 Thread Matthew Wilcox
On Fri, Sep 28, 2018 at 08:12:33PM -0700, John Hubbard wrote: > >> +++ b/drivers/infiniband/core/umem.c > >> @@ -60,7 +60,7 @@ static void __ib_umem_release(struct ib_device *dev, > >> struct ib_umem *umem, int d > >>page = sg_page(sg); > >>if (!PageDirty(page) &&

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-28 Thread John Hubbard
On 9/28/18 8:39 AM, Jason Gunthorpe wrote: > On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: >> From: John Hubbard [...] >> >> diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c >> index a41792dbae1f..9430d697cb9f 100644 >> +++

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-28 Thread John Hubbard
On 9/28/18 8:39 AM, Jason Gunthorpe wrote: > On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: >> From: John Hubbard [...] >> >> diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c >> index a41792dbae1f..9430d697cb9f 100644 >> +++

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-28 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: > From: John Hubbard > > For code that retains pages via get_user_pages*(), > release those pages via the new put_user_page(), > instead of put_page(). > > This prepares for eventually fixing the problem described > in [1],

Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call

2018-09-28 Thread Jason Gunthorpe
On Thu, Sep 27, 2018 at 10:39:47PM -0700, john.hubb...@gmail.com wrote: > From: John Hubbard > > For code that retains pages via get_user_pages*(), > release those pages via the new put_user_page(), > instead of put_page(). > > This prepares for eventually fixing the problem described > in [1],