[PATCH v12 22/22] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2020-01-07 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH v12 15/22] drm/via: set FOLL_PIN via pin_user_pages_fast()

2020-01-07 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH v12 14/22] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2020-01-07 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH v12 19/22] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2020-01-07 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Tested-by: Alex Williamson Acked-by: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/v

[PATCH v12 16/22] fs/io_uring: set FOLL_PIN via pin_user_pages()

2020-01-07 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 562e3a1a1bf9..9f804cb25c61 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4815,7 +4815,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v12 17/22] net/xdp: set FOLL_PIN via pin_user_pages()

2020-01-07 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v12 06/22] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2020-01-07 Thread John Hubbard
Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- mm/gup.c | 174 +-- 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 5938e29a5a8b..b61bd5c469ae 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -

[PATCH v12 12/22] goldish_pipe: convert to pin_user_pages() and put_user_page()

2020-01-07 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

Re: [Nouveau] [PATCH] nouveau: no need to check return value of debugfs_create functions

2020-02-13 Thread John Hubbard
, and simply return void from the debugfs functions--rather than playing whack-a-mole with this indefinitely? thanks, -- John Hubbard NVIDIA > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Sig

Re: [Nouveau] [PATCH] nouveau: no need to check return value of debugfs_create functions

2020-02-13 Thread John Hubbard
On 2/13/20 2:39 PM, Greg Kroah-Hartman wrote: > On Thu, Feb 13, 2020 at 02:30:09PM -0800, John Hubbard wrote: >> On 2/9/20 2:55 AM, Greg Kroah-Hartman wrote: >>> When calling debugfs functions, there is no need to ever check the >>> return value. The function can work

Re: [PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-09 Thread John Hubbard
On 1/7/20 2:45 PM, John Hubbard wrote: > Hi, > > The "track FOLL_PIN pages" would have been the very next patch, but it is > not included here because I'm still debugging a bug report from Leon. > Let's get all of the prerequisite work (it's been reviewed

Re: [PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-14 Thread John Hubbard
On 1/9/20 2:07 PM, John Hubbard wrote: > On 1/7/20 2:45 PM, John Hubbard wrote: >> Hi, >> >> The "track FOLL_PIN pages" would have been the very next patch, but it is >> not included here because I'm still debugging a bug report from Leon. >> L

Re: [PATCH v12 04/22] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2020-01-15 Thread John Hubbard
ge, GUP_PIN_COUNTING_BIAS)) + __put_page(page); + + __update_proc_vmstat(page, NR_FOLL_PIN_RETURNED, 1); +} +EXPORT_SYMBOL(unpin_user_page); [1] https://lore.kernel.org/r/20191216222537.491123-24-jhubb...@nvidia.com [PATCH v11 23/25] mm/gup: track FOLL_PIN pages thanks

Re: [PATCH v12 11/22] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2020-01-15 Thread John Hubbard
On 1/15/20 7:30 AM, Christoph Hellwig wrote: > On Tue, Jan 07, 2020 at 02:45:47PM -0800, John Hubbard wrote: >> Introduce pin_user_pages*() variations of get_user_pages*() calls, >> and also pin_longterm_pages*() variations. >> >> For now, these are placeholder calls, u

Re: [PATCH v12 04/22] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2020-01-16 Thread John Hubbard
On 1/16/20 1:37 AM, Christoph Hellwig wrote: On Wed, Jan 15, 2020 at 01:19:41PM -0800, John Hubbard wrote: On 1/15/20 7:23 AM, Christoph Hellwig wrote: ... I'm really not sold on this scheme. Note that I think it is particularly bad, but it also doesn't seem any better than w

Re: [PATCH v6 15/24] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-19 Thread John Hubbard
On 11/19/19 8:10 AM, Jens Axboe wrote: > On 11/19/19 1:16 AM, John Hubbard wrote: >> Convert fs/io_uring to use the new pin_user_pages() call, which sets >> FOLL_PIN. Setting FOLL_PIN is now required for code that requires >> tracking of pinned pages, and therefore fo

Re: [PATCH v6 17/24] mm/gup: track FOLL_PIN pages

2019-11-19 Thread John Hubbard
On 11/19/19 3:37 AM, Jan Kara wrote: > On Tue 19-11-19 00:16:36, John Hubbard wrote: >> @@ -2025,6 +2149,20 @@ static int __record_subpages(struct page *page, >> unsigned long addr, >> return nr; >> } >> >> +static bool __pin_compound_head(st

[PATCH v7 08/24] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-11-20 Thread John Hubbard
lling set_page_dirty_lock() if the CPU pages were potentially receiving data from the device. Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab Signed-off-by: John Hubbard --- drivers/media/v4l2-core/videobuf-dma-sg.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media

[PATCH v7 02/24] mm/gup: factor out duplicate code from four routines

2019-11-20 Thread John Hubbard
e the successful end of each routine, to increment *nr. Reviewed-by: Jérôme Glisse Reviewed-by: Jan Kara Cc: Ira Weiny Cc: Christoph Hellwig Cc: Aneesh Kumar K.V Signed-off-by: John Hubbard --- mm/gup.c | 91 ++-- 1 file changed, 36 insertions(+

[PATCH v7 13/24] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-20 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH v7 05/24] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-20 Thread John Hubbard
wed-by: Dan Williams Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Signed-off-by: John Hubbard --- include/linux/mm.h | 27 --- mm/memremap.c | 16 ++-- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/include/linux/mm.h b/incl

[PATCH v7 04/24] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2019-11-20 Thread John Hubbard
p is only needed in the MEMORY_DEVICE_FSDAX case, but it does no harm in the MEMORY_DEVICE_DEVDAX and MEMORY_DEVICE_PCI_P2PDMA case. Cc: Jan Kara Cc: Christoph Hellwig Cc: Ira Weiny Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Signed-off-by: Dan Williams Signed-off-by: Joh

[PATCH v7 01/24] mm/gup: pass flags arg to __gup_device_* functions

2019-11-20 Thread John Hubbard
A subsequent patch requires access to gup flags, so pass the flags argument through to the __gup_device_* functions. Also placate checkpatch.pl by shortening a nearby line. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Cc: Kirill A. Shutemov Signed-off-by: John

[PATCH v7 14/24] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-11-20 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH v7 12/24] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-11-20 Thread John Hubbard
ned-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_odp.c | 13 ++--- drivers/infiniband/hw/hfi1/user_pages.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/qib/qib_user_pag

[PATCH v7 15/24] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-20 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 2c819c3c855d..15715eeebaec 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3449,7 +3449,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v7 06/24] goldish_pipe: rename local pin_user_pages() routine

2019-11-20 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "pin_goldfish_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

[PATCH v7 00/24] mm/gup: track dma-pinned pages: FOLL_PIN

2019-11-20 Thread John Hubbard
get_user_pages() (Apr 2, 2019): https://lwn.net/Articles/784574/ [2] DMA and get_user_pages() (LPC: Dec 12, 2018): https://lwn.net/Articles/774411/ [3] The trouble with get_user_pages() (Apr 30, 2018): https://lwn.net/Articles/753027/ Dan Williams (1): mm: Cleanup __put_devmap_managed_page()

[PATCH v7 09/24] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-20 Thread John Hubbard
n Williams for helping clarify the DAX refactoring. Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 30 +- mm/gup

[PATCH v7 03/24] mm/gup: move try_get_compound_head() to top, fix minor issues

2019-11-20 Thread John Hubbard
An upcoming patch uses try_get_compound_head() more widely, so move it to the top of gup.c. Also fix a tiny spelling error and a checkpatch.pl warning. Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup.c | 29 +++-- 1 file changed, 15

[PATCH v7 22/24] mm/gup_benchmark: support pin_user_pages() and related calls

2019-11-20 Thread John Hubbard
s(), check each page: if page_dma_pinned() returns false, then WARN and return. Do this outside of the benchmark timestamps, so that it doesn't affect reported times. Cc: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 65 -- tools/t

[PATCH v7 23/24] selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage

2019-11-20 Thread John Hubbard
s are fairly early in the run_vmtests script, because with test suites, it's usually preferable to put the shorter, faster tests first, all other things being equal. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- tools/testing/selftests/vm/run_vmtests | 22 ++ 1 fi

[PATCH v7 16/24] net/xdp: set FOLL_PIN via pin_user_pages()

2019-11-20 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v7 11/24] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-11-20 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

[PATCH v7 17/24] mm/gup: track FOLL_PIN pages

2019-11-20 Thread John Hubbard
t/Articles/753027/ Suggested-by: Jan Kara Suggested-by: Jérôme Glisse Signed-off-by: John Hubbard --- Documentation/core-api/pin_user_pages.rst | 2 +- include/linux/mm.h| 113 +++- include/linux/mmzone.h| 2 + include/linux/page_ref.h

[PATCH v7 20/24] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-11-20 Thread John Hubbard
filled in. This is more accurate and should be a little safer from a maintenance point of view. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Signed-off-by: John Hubbard --- arch/powerpc/mm/book3s64/iommu_api.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) d

[PATCH v7 19/24] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-20 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Cc: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index c7a111ad997

[PATCH v7 21/24] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-11-20 Thread John Hubbard
t;gup_flags & 1" phrases in the function calls. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 9 ++--- tools/testing/selftests/vm/gup_benchmark.c | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a

[PATCH v7 18/24] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-20 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2

[PATCH v7 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-20 Thread John Hubbard
And get rid of the mmap_sem calls, as part of that. Note that get_user_pages_fast() will, if necessary, fall back to __gup_longterm_unlocked(), which takes the mmap_sem as needed. Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Signed-off-by: John Hubbard

[PATCH v7 24/24] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2019-11-20 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH v7 10/24] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-20 Thread John Hubbard
timil Babka for explaining the 4 cases in this documentation. (I've reworded it and expanded upon it.) Reviewed-by: Jan Kara Reviewed-by: Mike Rapoport # Documentation Reviewed-by: Jérôme Glisse Cc: Jonathan Corbet Cc: Ira Weiny Signed-off-by: John Hubbard --- Documentatio

Re: [PATCH v7 01/24] mm/gup: pass flags arg to __gup_device_* functions

2019-11-21 Thread John Hubbard
On 11/21/19 12:06 AM, Christoph Hellwig wrote: On Wed, Nov 20, 2019 at 11:13:31PM -0800, John Hubbard wrote: A subsequent patch requires access to gup flags, so pass the flags argument through to the __gup_device_* functions. Looks fine, but why not fold this into the patch using the flags

Re: [PATCH v7 02/24] mm/gup: factor out duplicate code from four routines

2019-11-21 Thread John Hubbard
On 11/21/19 12:03 AM, Christoph Hellwig wrote: On Wed, Nov 20, 2019 at 11:13:32PM -0800, John Hubbard wrote: There are four locations in gup.c that have a fair amount of code duplication. This means that changing one requires making the same changes in four places, not to mention reading the

Re: [PATCH v7 06/24] goldish_pipe: rename local pin_user_pages() routine

2019-11-21 Thread John Hubbard
On 11/21/19 12:08 AM, Christoph Hellwig wrote: On Wed, Nov 20, 2019 at 11:13:36PM -0800, John Hubbard wrote: +static int pin_goldfish_pages(unsigned long first_page, + unsigned long last_page, + unsigned int last_page_size

Re: [PATCH v7 09/24] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-21 Thread John Hubbard
On 11/21/19 12:10 AM, Christoph Hellwig wrote: Should this be two patches, one for th core infrastructure and one for the user? These changes also look like another candidate to pre-load. OK, I'll split them up. thanks, -- John Hubbard N

Re: [PATCH v7 05/24] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-21 Thread John Hubbard
'm running that now, will post the results. (btw, if there is a script and/or standard format I should use, I'm all ears. I'll dig through lwn...) thanks, -- John Hubbard NVIDIA ___ dri-devel mailing list dri-devel@li

Re: [PATCH v7 02/24] mm/gup: factor out duplicate code from four routines

2019-11-21 Thread John Hubbard
On 11/21/19 1:49 AM, Jan Kara wrote: On Thu 21-11-19 00:29:59, John Hubbard wrote: On 11/21/19 12:03 AM, Christoph Hellwig wrote: Otherwise this looks fine and might be a worthwhile cleanup to feed Andrew for 5.5 independent of the gut of the changes. Reviewed-by: Christoph Hellwig Thanks

Re: [PATCH v7 09/24] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM

2019-11-21 Thread John Hubbard
On 11/21/19 1:35 PM, Alex Williamson wrote: On Wed, 20 Nov 2019 23:13:39 -0800 John Hubbard wrote: As it says in the updated comment in gup.c: current FOLL_LONGTERM behavior is incompatible with FAULT_FLAG_ALLOW_RETRY because of the FS DAX check requirement on vmas. However, the

Re: [PATCH v7 05/24] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-11-21 Thread John Hubbard
On 11/21/19 8:59 AM, Dan Williams wrote: On Thu, Nov 21, 2019 at 12:57 AM John Hubbard wrote: On 11/21/19 12:05 AM, Christoph Hellwig wrote: So while this looks correct and I still really don't see the major benefit of the new code organization, especially as it bloats all put_page ca

Re: [PATCH v7 02/24] mm/gup: factor out duplicate code from four routines

2019-11-21 Thread John Hubbard
On 11/21/19 1:54 AM, Jan Kara wrote: On Thu 21-11-19 00:29:59, John Hubbard wrote: Otherwise this looks fine and might be a worthwhile cleanup to feed Andrew for 5.5 independent of the gut of the changes. Reviewed-by: Christoph Hellwig Thanks for the reviews! Say, it sounds like your view

Re: [PATCH v7 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-23 Thread John Hubbard
On 11/21/19 6:36 AM, Jason Gunthorpe wrote: > On Thu, Nov 21, 2019 at 12:07:46AM -0800, Christoph Hellwig wrote: >> On Wed, Nov 20, 2019 at 11:13:37PM -0800, John Hubbard wrote: >>> And get rid of the mmap_sem calls, as part of that. Note >>> that get_user_pages_fast

Re: [PATCH v7 07/24] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-11-24 Thread John Hubbard
On 11/24/19 2:07 AM, Leon Romanovsky wrote: > On Thu, Nov 21, 2019 at 10:36:43AM -0400, Jason Gunthorpe wrote: >> On Thu, Nov 21, 2019 at 12:07:46AM -0800, Christoph Hellwig wrote: >>> On Wed, Nov 20, 2019 at 11:13:37PM -0800, John Hubbard wrote: >>>> And get rid of

[PATCH 08/19] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-11-24 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

[PATCH 17/19] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-11-24 Thread John Hubbard
filled in. This is more accurate and should be a little safer from a maintenance point of view. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Signed-off-by: John Hubbard --- arch/powerpc/mm/book3s64/iommu_api.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) d

[PATCH 16/19] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-24 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Tested-by: Alex Williamson Acked-by: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/v

[PATCH 10/19] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-24 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH 18/19] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-11-24 Thread John Hubbard
t;gup_flags & 1" phrases in the function calls. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 9 ++--- tools/testing/selftests/vm/gup_benchmark.c | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a

[PATCH 06/19] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2019-11-24 Thread John Hubbard
's no need for it at the VFIO call site. So remove it. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfi

[PATCH 11/19] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-11-24 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH 12/19] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-24 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 010003b4b60b..0f7898b1c4b0 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4185,7 +4185,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH 13/19] net/xdp: set FOLL_PIN via pin_user_pages()

2019-11-24 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 07/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-24 Thread John Hubbard
timil Babka for explaining the 4 cases in this documentation. (I've reworded it and expanded upon it.) Reviewed-by: Jan Kara Reviewed-by: Mike Rapoport # Documentation Reviewed-by: Jérôme Glisse Cc: Jonathan Corbet Cc: Ira Weiny Signed-off-by: John Hubbard --- Documentatio

[PATCH 04/19] goldish_pipe: rename local pin_user_pages() routine

2019-11-24 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "goldfish_pin_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

[PATCH 09/19] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-11-24 Thread John Hubbard
ned-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_odp.c | 13 ++--- drivers/infiniband/hw/hfi1/user_pages.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/qib/qib_user_pag

[PATCH 03/19] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2019-11-24 Thread John Hubbard
p is only needed in the MEMORY_DEVICE_FSDAX case, but it does no harm in the MEMORY_DEVICE_DEVDAX and MEMORY_DEVICE_PCI_P2PDMA case. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Cc: Jan Kara Cc: Ira Weiny Signed-off-by: Dan Williams Signed-off-by: John Hubbard --- drivers/nvdimm/pm

[PATCH 01/19] mm/gup: factor out duplicate code from four routines

2019-11-24 Thread John Hubbard
e the successful end of each routine, to increment *nr. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Reviewed-by: Jan Kara Cc: Ira Weiny Cc: Christoph Hellwig Cc: Aneesh Kumar K.V Signed-off-by: John Hubbard --- mm/gup.c | 91 ++

[PATCH 19/19] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2019-11-24 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH 05/19] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2019-11-24 Thread John Hubbard
Thanks to Jason Gunthorpe for pointing out a clean way to fix this, and to Dan Williams for helping clarify the DAX refactoring. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Gl

[PATCH 15/19] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-24 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2

[PATCH 14/19] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-11-24 Thread John Hubbard
lling set_page_dirty_lock() if the CPU pages were potentially receiving data from the device. Reviewed-by: Christoph Hellwig Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: Signed-off-by: John Hubbard --- drivers/media/v4l2-core/videobuf-dma-sg.c | 5 - 1 file changed, 4 insertions(+), 1 del

[PATCH 00/19] pin_user_pages(): reduced-risk series for Linux 5.5

2019-11-24 Thread John Hubbard
get_user_pages(FOLL_LONGTERM) (also sets FOLL_GET) put_page() to this: pin_longterm_pages() (sets FOLL_PIN | FOLL_LONGTERM) put_user_page() [1] https://lore.kernel.org/r/20191121071354.456618-1-jhubb...@nvidia.com thanks, John Hubbard NVIDIA Dan Williams (1): mm: Cleanup __put_devmap

[PATCH 02/19] mm/gup: move try_get_compound_head() to top, fix minor issues

2019-11-24 Thread John Hubbard
An upcoming patch uses try_get_compound_head() more widely, so move it to the top of gup.c. Also fix a tiny spelling error and a checkpatch.pl warning. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup.c | 29

Re: [PATCH 07/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-25 Thread John Hubbard
to help > improve the system. BTW, we also suggest to use '--base' option to specify the > base tree in git format-patch, please see > https://stackoverflow.com/a/37406982] > > url: > https://github.com/0day-ci/linux/commits/John-Hubbard/pin_user_pages-reduced-risk-ser

Re: [PATCH 17/19] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-11-25 Thread John Hubbard
On 11/25/19 12:59 AM, Jan Kara wrote: > On Sun 24-11-19 20:20:09, John Hubbard wrote: >> 1. Convert from get_user_pages() to pin_user_pages(). >> >> 2. As required by pin_user_pages(), release these pages via >> put_user_page(). In this case, do so via put_user_pages_d

[PATCH v2 06/19] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2019-11-25 Thread John Hubbard
's no need for it at the VFIO call site. So remove it. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfi

[PATCH v2 11/19] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-11-25 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH v2 14/19] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-11-25 Thread John Hubbard
lling set_page_dirty_lock() if the CPU pages were potentially receiving data from the device. Reviewed-by: Christoph Hellwig Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: Signed-off-by: John Hubbard --- drivers/media/v4l2-core/videobuf-dma-sg.c | 5 - 1 file changed, 4 insertions(+), 1 del

[PATCH v2 09/19] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-11-25 Thread John Hubbard
ned-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_odp.c | 13 ++--- drivers/infiniband/hw/hfi1/user_pages.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/qib/qib_user_pag

[PATCH v2 02/19] mm/gup: move try_get_compound_head() to top, fix minor issues

2019-11-25 Thread John Hubbard
An upcoming patch uses try_get_compound_head() more widely, so move it to the top of gup.c. Also fix a tiny spelling error and a checkpatch.pl warning. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup.c | 29

[PATCH v2 10/19] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-11-25 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH v2 08/19] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-11-25 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

[PATCH v2 01/19] mm/gup: factor out duplicate code from four routines

2019-11-25 Thread John Hubbard
e the successful end of each routine, to increment *nr. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Reviewed-by: Jan Kara Cc: Ira Weiny Cc: Christoph Hellwig Cc: Aneesh Kumar K.V Signed-off-by: John Hubbard --- mm/gup.c | 91 ++

[PATCH v2 03/19] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2019-11-25 Thread John Hubbard
p is only needed in the MEMORY_DEVICE_FSDAX case, but it does no harm in the MEMORY_DEVICE_DEVDAX and MEMORY_DEVICE_PCI_P2PDMA case. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Cc: Jan Kara Cc: Ira Weiny Signed-off-by: Dan Williams Signed-off-by: John Hubbard --- drivers/nvdimm/pm

[PATCH v2 05/19] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2019-11-25 Thread John Hubbard
Thanks to Jason Gunthorpe for pointing out a clean way to fix this, and to Dan Williams for helping clarify the DAX refactoring. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Gl

[PATCH v2 13/19] net/xdp: set FOLL_PIN via pin_user_pages()

2019-11-25 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 00/19] pin_user_pages(): reduced-risk series for Linux 5.5

2019-11-25 Thread John Hubbard
applied. The change was from this: get_user_pages(FOLL_LONGTERM) (also sets FOLL_GET) put_page() to this: pin_longterm_pages() (sets FOLL_PIN | FOLL_LONGTERM) unpin_user_page() [1] https://lore.kernel.org/r/20191121071354.456618-1-jhubb...@nvidia.com thanks, John Hubbard NVIDIA Da

[PATCH v2 04/19] goldish_pipe: rename local pin_user_pages() routine

2019-11-25 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "goldfish_pin_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

[PATCH v2 12/19] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-11-25 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index e5bff60f61d6..869191d8f8d4 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4239,7 +4239,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v2 07/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-11-25 Thread John Hubbard
timil Babka for explaining the 4 cases in this documentation. (I've reworded it and expanded upon it.) Reviewed-by: Jan Kara Reviewed-by: Mike Rapoport # Documentation Reviewed-by: Jérôme Glisse Cc: Jonathan Corbet Cc: Ira Weiny Signed-off-by: John Hubbard --- Documentatio

[PATCH v2 19/19] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2019-11-25 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH v2 16/19] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-25 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Tested-by: Alex Williamson Acked-by: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/v

[PATCH v2 15/19] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-11-25 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2

[PATCH v2 18/19] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-11-25 Thread John Hubbard
t;gup_flags & 1" phrases in the function calls. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 9 ++--- tools/testing/selftests/vm/gup_benchmark.c | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a

[PATCH v2 17/19] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-11-25 Thread John Hubbard
accurate. As Christoph Hellwig put it, "set_page_dirty() is only safe if we are dealing with a file backed page where we have reference on the inode it hangs off." [1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Cc: Jan Kara Signed-off-by: John Hubbard --- arch/powerpc/m

Re: [PATCH v2 17/19] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-11-29 Thread John Hubbard
On 11/29/19 3:23 AM, Jan Kara wrote: On Mon 25-11-19 15:10:33, John Hubbard wrote: 1. Convert from get_user_pages() to pin_user_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). In this case, do so via put_user_pages_dirty_lock(). That has the side effect

Re: [GIT PULL] Please pull hmm changes

2019-12-05 Thread John Hubbard
<- struct mmu_notifier_mm notif_subscription (notif_sub) <- struct mmu_notifier notif_invalidate_desc <- struct mmu_notifier_range* notif_range_subscription (notif_range_sub) <- struct mmu_interval_notifier thanks, -- John Hubbard NVIDIA ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v8 15/26] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-12-09 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 405be10da73d..9639ebc21e8a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4521,7 +4521,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v8 07/26] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2019-12-09 Thread John Hubbard
's no need for it at the VFIO call site. So remove it. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfi

[PATCH v8 05/26] goldish_pipe: rename local pin_user_pages() routine

2019-12-09 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "goldfish_pin_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

<    1   2   3   4   5   6   7   >