Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
On 10/27/20 2:55 AM, Christoph Hellwig wrote: On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: Actually there are callers that care about partial success. See e.g. iov_iter_get_pages() usage in fs/direct_io.c:dio_refill_pages() or bio_iov_iter_get_pages(). These places handle partial

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
On 10/27/20 11:00 PM, John Hubbard wrote: On 10/27/20 6:15 AM, Jason Gunthorpe wrote: On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: On Fri 23-10-20 21:44:17, John Hubbard wrote: On 10/23/20 5:19 PM, Jason Gunthorpe wrote: ... I'll fix up that one above (using your Reported-by,

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
On 10/27/20 6:15 AM, Jason Gunthorpe wrote: On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: On Fri 23-10-20 21:44:17, John Hubbard wrote: On 10/23/20 5:19 PM, Jason Gunthorpe wrote: + start += (unsigned long)nr_pinned << PAGE_SHIFT; + pages += nr_pinned; + ret =

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-27 Thread Jason Gunthorpe
On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: > On Fri 23-10-20 21:44:17, John Hubbard wrote: > > On 10/23/20 5:19 PM, Jason Gunthorpe wrote: > > > + start += (unsigned long)nr_pinned << PAGE_SHIFT; > > > + pages += nr_pinned; > > > + ret = __gup_longterm_unlocked(start, nr_pages -

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-27 Thread Christoph Hellwig
On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: > Actually there are callers that care about partial success. See e.g. > iov_iter_get_pages() usage in fs/direct_io.c:dio_refill_pages() or > bio_iov_iter_get_pages(). These places handle partial success just fine and > not allowing partial

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-27 Thread Jan Kara
On Fri 23-10-20 21:44:17, John Hubbard wrote: > On 10/23/20 5:19 PM, Jason Gunthorpe wrote: > > + start += (unsigned long)nr_pinned << PAGE_SHIFT; > > + pages += nr_pinned; > > + ret = __gup_longterm_unlocked(start, nr_pages - nr_pinned, gup_flags, > > +

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-26 Thread Jason Gunthorpe
On Fri, Oct 23, 2020 at 09:44:17PM -0700, John Hubbard wrote: > > Signed-off-by: Jason Gunthorpe > > mm/gup.c | 88 +--- > > 1 file changed, 46 insertions(+), 42 deletions(-) > > > > diff --git a/mm/gup.c b/mm/gup.c > > index

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-23 Thread John Hubbard
On 10/23/20 5:19 PM, Jason Gunthorpe wrote: The next patch in this series makes the lockless flow a little more complex, so move the entire block into a new function and remove a level of indention. Tidy a bit of cruft: - addr is always the same as start, so use start - Use the modern