[PATCH v2 0/2] vhost, docs: convert to pin_user_pages(), new "case 5"

2020-05-31 Thread John Hubbard
ps://lore.kernel.org/r/20200527194953.11130-1-jhubb...@nvidia.com [2] https://lore.kernel.org/r/20200529070343.gl14...@quack2.suse.cz John Hubbard (2): docs: mm/gup: pin_user_pages.rst: add a "case 5" vhost: convert get_user_pages() --> pin_user_pages() Documentation

[PATCH v2 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-05-31 Thread John Hubbard
unpin" case. Add a fifth case, to help explain that there is a general pattern that requires pin_user_pages*() API calls. Cc: Vlastimil Babka Cc: Jan Kara Cc: Jérôme Glisse Cc: Dave Chinner Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Signed-of

Re: [PATCH 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-05-31 Thread John Hubbard
age_dirty_lock() +put_page() + I'll send a v2 shortly. thanks, -- John Hubbard NVIDIA

Re: [PATCH] staging: kpc2000: kpc_dma: Convert get_user_pages() --> pin_user_pages()

2020-05-31 Thread John Hubbard
lock(). See below. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: Souptick Joarder Cc: John Hubbard --- Hi, I'm compile tested this, but unable to run-time test, so any testing he

[PATCH v2 2/2] mm/gup: frame_vector: convert get_user_pages() --> pin_user_pages()

2020-05-31 Thread John Hubbard
c: David Hildenbrand Signed-off-by: John Hubbard --- mm/frame_vector.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/frame_vector.c b/mm/frame_vector.c index c431ca81dad5..4107dbca0056 100644 --- a/mm/frame_vector.c +++ b/mm/frame_vector.c @@ -72,7 +72,7 @@ int get_v

[PATCH v2 1/2] mm/gup: introduce pin_user_pages_locked()

2020-05-31 Thread John Hubbard
add that as part of this. Cc: Souptick Joarder Reviewed-by: David Hildenbrand Acked-by: Pankaj Gupta Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 36 2 files changed, 38 insertions(+) diff --git a/include/linux/mm.h b

[PATCH v2 0/2] mm/gup: introduce pin_user_pages_locked(), use it in frame_vector.c

2020-05-31 Thread John Hubbard
Hi, Changes since v1: * added an assert-and-return to the corresponding get_user_pages_locked() call, to keep out any externally set FOLL_PIN flag, thanks to Souptick Joarder's review for spotting that. * Added Acked-by and Reviewed by tags from David and Pakaj John Hubbard (2): mm/gup

[PATCH v2 1/2] mm/gup: introduce pin_user_pages_unlocked

2020-05-31 Thread John Hubbard
in the get_user_pages*() call, so add that as part of this. Cc: Souptick Joarder Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 23 +++ 2 files changed, 25 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index f3fe7371855c

[PATCH v2 2/2] ivtv: convert get_user_pages() --> pin_user_pages()

2020-05-31 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- dr

[PATCH v2 0/2] mm/gup, media/ivtv: introduce pin_user_pages_unlocked

2020-05-31 Thread John Hubbard
-by. I've run this patchset through non-destructive xfstests, and a few other things such as LTP. However, I'm not set up for IVTV specific testing. [1] https://lore.kernel.org/r/d11d52f8-d54c-bb45-bde9-198235a03...@nvidia.com John Hubbard (2): mm/gup: introduce pin_user_pages_unlocked ivtv

Re: [PATCH 0/2] video: fbdev: fix error handling, convert to pin_user_pages*()

2020-05-31 Thread John Hubbard
, as part of commit 434502754f2 ("[PATCH] SH Merge") ...and that commit created the minor bug that patch 0001 here addresses. (+Cc Paul just for the sake of completeness.) [1] git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git thanks, -- John Hubbard NVIDIA

Re: [PATCH 0/2] video: fbdev: fix error handling, convert to pin_user_pages*()

2020-05-31 Thread John Hubbard
On 2020-05-31 13:58, Sam Ravnborg wrote: ... Thanks, patches are now applied to drm-misc-next. They will hit -next soon, but you will have to wait until next (not the upcoming) merge window before they hit mainline linux. Sam Great! That will work out just fine. thanks, -- John

Re: [PATCH 1/2] mm/gup: introduce pin_user_pages_locked()

2020-05-31 Thread John Hubbard
On 2020-05-31 00:13, Souptick Joarder wrote: On Sun, May 31, 2020 at 12:34 PM Souptick Joarder wrote: On Thu, May 28, 2020 at 4:02 AM John Hubbard wrote: Introduce pin_user_pages_locked(), which is nearly identical to get_user_pages_locked() except that it sets FOLL_PIN and rejects

Re: [PATCH 1/2] mm/gup: introduce pin_user_pages_locked()

2020-05-31 Thread John Hubbard
thanks, -- John Hubbard NVIDIA

Re: [PATCH v2] orangefs: convert get_user_pages() --> pin_user_pages()

2020-05-30 Thread John Hubbard
On 2020-05-22 20:59, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 1" scenario (Direct IO), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. The

[PATCH 2/2] vhost: convert get_user_pages() --> pin_user_pages()

2020-05-29 Thread John Hubbard
: Michael S. Tsirkin Cc: Jason Wang Cc: k...@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org Cc: net...@vger.kernel.org Signed-off-by: John Hubbard --- drivers/vhost/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers

[PATCH 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-05-29 Thread John Hubbard
unpin" case. Add a fifth case, to help explain that there is a general pattern that requires pin_user_pages*() API calls. Cc: Vlastimil Babka Cc: Jan Kara Cc: Jérôme Glisse Cc: Dave Chinner Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Signed-of

[PATCH 0/2] vhost, docs: convert to pin_user_pages(), new "case 5"

2020-05-29 Thread John Hubbard
include cross-compiling for a few other arches. Any run-time testing would be greatly appreciated. [1] https://lore.kernel.org/r/20200529070343.gl14...@quack2.suse.cz John Hubbard (2): docs: mm/gup: pin_user_pages.rst: add a "case 5" vhost: convert get_user_pages() --> p

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
be a "nice to have", though, if anyone were able to do a performance comparison on the gasket driver for this patch, and/or basic runtime verification, since I'm sure it's a specialized setup. thanks, -- John Hubbard NVIDIA

Re: [PATCH 0/3] misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages()

2020-05-29 Thread John Hubbard
On 2020-05-29 01:29, Dragan Cvetic wrote: Hi John, Thank you for the suggestion, please find my comment below: -Original Message- From: John Hubbard Sent: Wednesday 27 May 2020 02:26 To: LKML Cc: Souptick Joarder ; John Hubbard ; Derek Kiernan ; Dragan Cvetic ; Arnd Bergmann ; Greg

[PATCH] mm/gup: documentation fix for pin_user_pages*() APIs

2020-05-29 Thread John Hubbard
guidance. So let's just write it once, there. [1] https://lore.kernel.org/r/20200529074658.GM30374@kadam Cc: Dan Carpenter Cc: Jan Kara Cc: Vlastimil Babka Signed-off-by: John Hubbard --- Hi, This applies on top of linux-next, in order to avoid a conflict with Mauro Carvalho Chehab's fix

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
internal_get_user_pages_fast(start, nr_pages, gup_flags, pages); 2891 } 2892 EXPORT_SYMBOL_GPL(pin_user_pages_fast); regards, dan carpenter thanks, -- John Hubbard NVIDIA

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
hes so far, but that sure doesn't mean it's perfect! :) Maybe adding the words that Dan suggests, above, will suffice? Here: >>> "In 2019 we introduced pin_user_pages() and now we are converting >>> get_user_pages() to the new API as appropriate". thanks, -- John Hubbard NVIDIA

Re: [PATCH] drm/radeon: Convert get_user_pages() --> pin_user_pages()

2020-05-29 Thread John Hubbard
.) There were no *case 5* in the other patch posted in -mm. Do we need to add it ? Working on figuring that out [1], but it's not directly relevant to this thread. Maybe I shouldn't have brought it up here. :) [1] https://lore.kernel.org/r/20200529070343.gl14...@quack2.suse.cz thanks, John Hubbard

[PATCH 2/2] mm/gup: frame_vector: convert get_user_pages() --> pin_user_pages()

2020-05-27 Thread John Hubbard
me helpful background in [2]: basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/

[PATCH 0/2] mm/gup: introduce pin_user_pages_locked(), use it in frame_vector.c

2020-05-27 Thread John Hubbard
gup call sites converted--with the notable exception of the bio/block layer. [1] https://lore.kernel.org/r/20200518012157.1178336-2-jhubb...@nvidia.com John Hubbard (2): mm/gup: introduce pin_user_pages_locked() mm/gup: frame_vector: convert get_user_pages() --> pin_user_pages() incl

[PATCH 1/2] mm/gup: introduce pin_user_pages_locked()

2020-05-27 Thread John Hubbard
Introduce pin_user_pages_locked(), which is nearly identical to get_user_pages_locked() except that it sets FOLL_PIN and rejects FOLL_GET. Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 30 ++ 2 files changed, 32 insertions(+) diff

[PATCH] mm/gup: update pin_user_pages.rst for "case 3" (mmu notifiers)

2020-05-27 Thread John Hubbard
: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Signed-off-by: John Hubbard --- Documentation/core-api/pin_user_pages.rst | 33 +-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Documentation/core-api/pin_user_pages.rst b/Documentation/core-api

Re: [PATCH] drm/radeon: Convert get_user_pages() --> pin_user_pages()

2020-05-27 Thread John Hubbard
On 2020-05-27 01:51, Daniel Vetter wrote: On Wed, May 27, 2020 at 10:48:52AM +0200, Daniel Vetter wrote: On Tue, May 26, 2020 at 03:57:45PM -0700, John Hubbard wrote: On 2020-05-26 14:00, Souptick Joarder wrote: This code was using get_user_pages(), in a "Case 2" scenario (DMA/RD

[PATCH 0/3] misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
. Any run-time testing would be greatly appreciated! Cc: Derek Kiernan Cc: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-ker...@lists.infradead.org John Hubbard (3): misc: xilinx-sdfec: improve get_user_pages_fast() error handling misc: xilinx-sdfec

[PATCH 2/3] misc: xilinx-sdfec: cleanup return value in xsdfec_table_write()

2020-05-26 Thread John Hubbard
radead.org Signed-off-by: John Hubbard --- drivers/misc/xilinx_sdfec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c index e2766aad9e14..7e2ee3e547f2 100644 --- a/drivers/misc/xilinx_sdfec.c +++ b/drivers/misc/xili

[PATCH 3/3] misc: xilinx-sdfec: convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
c: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: John Hubbard --- drivers/misc/xilinx_sdfec.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/

[PATCH 1/3] misc: xilinx-sdfec: improve get_user_pages_fast() error handling

2020-05-26 Thread John Hubbard
most other call sites. Fixes: 20ec628e8007e ("misc: xilinx_sdfec: Add ability to configure LDPC") Cc: Derek Kiernan Cc: Dragan Cvetic Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Michal Simek Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: John Hubbard --- drivers/misc

Re: [PATCH v2] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
anks, John Hubbard NVIDIA On 2020-05-26 11:27, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 1" scenario (Direct IO), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpi

Re: [PATCH] drm/radeon: Convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
/807108/ Signed-off-by: Souptick Joarder Cc: John Hubbard Hi, I'm compile tested this, but unable to run-time test, so any testing help is much appriciated. --- drivers/gpu/drm/radeon/radeon_ttm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ra

Re: [PATCH 1/1] vfio/spapr_tce: convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
tuations (Case 4, in Documentation/core-api/pin_user_pages.rst: struct page manipulation) in which it operates on single pages. Those will remain get_user_pages*() calls, or perhaps change to get_user_page(). thanks, -- John Hubbard NVIDIA

[PATCH v2] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
Petersen Cc: linux-s...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, As mentioned in the v1 review thread, we probably still want/need this. Or so I claim. :) Please see what you think... Changes since v1: changed the commit log, to refer to Direct IO (Case 1), instead of DMA/RDMA (C

Re: [PATCH] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
On 2020-05-22 01:32, "Kai Mäkisara (Kolumbus)" wrote: On 21. May 2020, at 22.47, Bart Van Assche wrote: On 2020-05-18 21:55, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that

Re: [PATCH] mm/gup: correct pin_user_pages.rst location

2020-05-26 Thread John Hubbard
IN") Signed-off-by: Vitaly Kuznetsov --- include/linux/mm.h | 4 ++-- mm/gup.c | 18 +- 2 files changed, 11 insertions(+), 11 deletions(-) Hi Vitaly, Thanks for the fix, Reviewed-by: John Hubbard (+CC Souptick, who fixed a similar set of links, maybe in a

Re: [RFC 07/16] KVM: mm: Introduce VM_KVM_PROTECTED

2020-05-26 Thread John Hubbard
returning */ #define FOLL_PIN 0x4 /* pages must be released via unpin_user_page */ +#define FOLL_KVM 0x8 /* access to VM_KVM_PROTECTED VMAs */ I grabbed 0x8 already, for FOLL_FAST_ONLY. :) thanks, -- John Hubbard NVIDIA

[PATCH 2/2] KVM: SVM: convert get_user_pages() --> pin_user_pages()

2020-05-26 Thread John Hubbard
Cc: Thomas Gleixner Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: H. Peter Anvin Cc: x...@kernel.org Cc: k...@vger.kernel.org Signed-off-by: John Hubbard --- arch/x86/kvm/svm/sev.c | 6 +++--- 1 file changed, 3 insert

[PATCH 0/2] KVM: SVM: convert get_user_pages() --> pin_user_pages(), bug fixes

2020-05-26 Thread John Hubbard
: Ingo Molnar Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Cc: H. Peter Anvin Cc: x...@kernel.org Cc: k...@vger.kernel.org John Hubbard (2): KVM: SVM: fix svn_pin_memory()'s use

[PATCH 1/2] KVM: SVM: fix svn_pin_memory()'s use of get_user_pages_fast()

2020-05-26 Thread John Hubbard
Cc: Jim Mattson Cc: Joerg Roedel Cc: H. Peter Anvin Cc: x...@kernel.org Cc: k...@vger.kernel.org Signed-off-by: John Hubbard --- arch/x86/kvm/svm/sev.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 89f7f3aebd31.

Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-25 Thread John Hubbard
opriate in mm.h, yes. thanks, -- John Hubbard NVIDIA

[PATCH v2] drm/etnaviv: convert get_user_pages() --> pin_user_pages()

2020-05-25 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- H

[PATCH v2] tee: convert get_user_pages() --> pin_user_pages()

2020-05-25 Thread John Hubbard
umit Semwal Cc: tee-...@lists.linaro.org Cc: linux-me...@vger.kernel.org Cc: dri-de...@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Signed-off-by: John Hubbard --- Hi, This fixes the typo ("convert convert") in the subject line, but otherwise no changes. thanks, John Hubbard NVIDIA

[PATCH v3] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-25 Thread John Hubbard
: Moritz Fischer Cc: linux-f...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, This is the same logical change as in v2, but it is applied to char-misc-next, in order to avoid a merge problem with Souptick's commit c9d7e3da1f3c ("fpga: dfl: afu: Corrected error handling levels "

Re: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-25 Thread John Hubbard
pages() on a swapped out page, another guest can be scheduled while + * waiting for IO to swap in guest A's page. */ #define FAULT_FLAG_WRITE 0x01 #define FAULT_FLAG_MKWRITE 0x02 thanks, -- John Hubbard NVIDIA

Re: linux-next: build failure after merge of the akpm tree

2020-05-25 Thread John Hubbard
good. And in fact, Andrew has the same fix-up in the mmotm branch of linux-next.git, as commit a76c281a8ddd ("mmap-locking-api-rename-mmap_sem-to-mmap_lock-fix"). thanks, -- John Hubbard NVIDIA

Re: [PATCH v2] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-24 Thread John Hubbard
suggestion? I'll send you a v2, rebased on top of the latest char-misc.git, no problem. thanks, -- John Hubbard NVIDIA

Re: [linux-next RFC v2] mm/gup.c: Convert to use get_user_{page|pages}_fast_only()

2020-05-24 Thread John Hubbard
any existing functionality of the API. All the callers are changed to pass FOLL_WRITE. This looks good. A few nits below, but with those fixed, feel free to add: Reviewed-by: John Hubbard There are few places where 1 is passed to 2nd parameter of __get_user_pages_fast() and return value

Re: [PATCH v2 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-23 Thread John Hubbard
On 2020-05-23 02:41, Chris Wilson wrote: Quoting John Hubbard (2020-05-22 06:19:27) The purpose of posting this series is to launch a test in the intel-gfx-ci tree. (The patches have already been merged into Andrew's linux-mm tree.) This applies to today's linux.git (note the base-commit tag

Re: [PATCH v2] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-23 Thread John Hubbard
On 2020-05-23 13:57, Moritz Fischer wrote: On Fri, May 22, 2020 at 06:52:34PM -0700, John Hubbard wrote: On 2020-05-19 13:14, John Hubbard wrote: This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that

[PATCH v2] orangefs: convert get_user_pages() --> pin_user_pages()

2020-05-22 Thread John Hubbard
Brandenburg Cc: de...@lists.orangefs.org Cc: linux-fsde...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, Note that I have only compile-tested this patch, although that does also include cross-compiling for a few other arches. Changes since v1 [3]: correct the commit description, so that it refers

Re: [PATCH v2] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-22 Thread John Hubbard
On 2020-05-19 13:14, John Hubbard wrote: This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages_fast() + put_page() calls to pin_user_pages_fast() + unpin_user_pag

[PATCH 1/1] vfio/spapr_tce: convert get_user_pages() --> pin_user_pages()

2020-05-22 Thread John Hubbard
Cornelia Huck Cc: k...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, I'm compile-tested this, but am not able to run-time test, so any testing help is much appreciated! thanks, John Hubbard NVIDIA drivers/vfio/vfio_iommu_spapr_tce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-22 Thread John Hubbard
on the latest linux-next (which has my changes now). Should be fine. And in fact it would be nice to get that done in this round, so that the pin* and get* APIs look the same. thanks, -- John Hubbard NVIDIA

[PATCH v2 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-21 Thread John Hubbard
to change the name as well, to whatever the consensus is. My initial recommendation is: get_user_pages_fast_only(), to match the new pin_user_pages_only(). John Hubbard (4): mm/gup: move __get_user_pages_fast() down a few lines in gup.c mm/gup: refactor and de-duplicate gup_fast() code mm

[PATCH v2 1/4] mm/gup: move __get_user_pages_fast() down a few lines in gup.c

2020-05-21 Thread John Hubbard
This is in order to avoid a forward declaration of internal_get_user_pages_fast(), in the next patch. This is code movement only--all generated code should be identical. Signed-off-by: John Hubbard --- mm/gup.c | 112 +++ 1 file changed, 56

[PATCH v2 2/4] mm/gup: refactor and de-duplicate gup_fast() code

2020-05-21 Thread John Hubbard
f enabling interrupts was fragile at best. Signed-off-by: John Hubbard --- include/linux/mm.h | 1 + mm/gup.c | 63 ++ 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index a5

[PATCH v2 4/4] drm/i915: convert get_user_pages() --> pin_user_pages()

2020-05-21 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- driv

[PATCH v2 3/4] mm/gup: introduce pin_user_pages_fast_only()

2020-05-21 Thread John Hubbard
This is the FOLL_PIN equivalent of __get_user_pages_fast(), except with a more descriptive name, and gup_flags instead of a boolean "write" in the argument list. Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 36 +++

[PATCH 1/2] video: fbdev: fix error handling for get_user_pages_fast()

2020-05-21 Thread John Hubbard
get one. And explain this with comments, seeing as how it is error-prone. Cc: Bartlomiej Zolnierkiewicz Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Gustavo A. R. Silva Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org Signed-off-by: John Hubbard --- drivers/video

[PATCH 0/2] video: fbdev: fix error handling, convert to pin_user_pages*()

2020-05-21 Thread John Hubbard
Vetter Cc: Gustavo A. R. Silva Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org John Hubbard (2): video: fbdev: fix error handling for get_user_pages_fast() video: fbdev: convert get_user_pages() --> pin_user_pages() drivers/video/fbdev/

[PATCH 2/2] video: fbdev: convert get_user_pages() --> pin_user_pages()

2020-05-21 Thread John Hubbard
Bergmann Cc: Daniel Vetter Cc: Gustavo A. R. Silva Cc: Jani Nikula Cc: dri-de...@lists.freedesktop.org Cc: linux-fb...@vger.kernel.org Signed-off-by: John Hubbard --- drivers/video/fbdev/pvr2fb.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/pvr2

Re: [PATCH] mm/gup: fixup gup.c for "mm/gup: refactor and de-duplicate gup_fast() code"

2020-05-21 Thread John Hubbard
On 2020-05-21 19:46, Chris Wilson wrote: Quoting John Hubbard (2020-05-22 00:38:41) Include FOLL_FAST_ONLY in the list of flags to *not* WARN() on, in internal_get_user_pages_fast(). Cc: Chris Wilson Cc: Daniel Vetter Cc: David Airlie Cc: Jani Nikula Cc: "Joonas Lahtinen" Cc: Ma

[PATCH] mm/gup: might_lock_read(mmap_sem) in get_user_pages_fast()

2020-05-21 Thread John Hubbard
Lespinasse Cc: Jason Gunthorpe Signed-off-by: John Hubbard --- Hi Andrew, This applies on top of [1], which in turn applies to today's (20200521) linux-next. As noted in the discussion [2], this will need changing from mmap_sem to mmap_lock, after Michel Lespinasse's patchset arrives. [1

[PATCH] mm/gup: fixup gup.c for "mm/gup: refactor and de-duplicate gup_fast() code"

2020-05-21 Thread John Hubbard
ko Ursulin Signed-off-by: John Hubbard --- Hi Andrew, Chris, Andrew: This is a fixup that applies to today's (20200521) linux-next. In that tree, this fixes up: commit dfb8dfe80808 ("mm/gup: refactor and de-duplicate gup_fast() code") Chris: I'd like to request another CI run for the

Solved: [PATCH 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-21 Thread John Hubbard
On 2020-05-21 12:11, John Hubbard wrote: On 2020-05-21 11:57, Chris Wilson wrote: Quoting John Hubbard (2020-05-19 01:21:20) This needs to go through Andrew's -mm tree, due to adding a new gup.c routine. However, I would really love to have some testing from the drm/i915 folks, because I

Re: [PATCH] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-21 Thread John Hubbard
On 2020-05-21 12:47, Bart Van Assche wrote: On 2020-05-18 21:55, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_

Re: [PATCH 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-21 Thread John Hubbard
On 2020-05-21 11:57, Chris Wilson wrote: Quoting John Hubbard (2020-05-19 01:21:20) This needs to go through Andrew's -mm tree, due to adding a new gup.c routine. However, I would really love to have some testing from the drm/i915 folks, because I haven't been able to run-time test that part

[PATCH] rds: fix crash in rds_info_getsockopt()

2020-05-20 Thread John Hubbard
;) Cc: David S. Miller Cc: Jakub Kicinski Cc: net...@vger.kernel.org Cc: linux-r...@vger.kernel.org Cc: rds-de...@oss.oracle.com Signed-off-by: John Hubbard --- net/rds/info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rds/info.c b/net/rds/info.c index

Re: [PATCH v5.5 10/10] mmap locking API: rename mmap_sem to mmap_lock

2020-05-20 Thread John Hubbard
patchset, but it doesn't seem worth doing if we know this will conflict with your changes. Sure, that's no problem. Although it looks like my changes may land in mmotm first, and then your patchset, so maybe the right move is to make this change *after* both of those things happen, yes? thanks, -- John Hubbard NVIDIA

Re: [RFC V2] mm/vmstat: Add events for PMD based THP migration without split

2020-05-19 Thread John Hubbard
. Not worth worrying about, but I do recall a few recent code reviews that all preferred the multi-line version, which is why I suggested it. Anyway, either way, with the thp_pmd_migration_success() name change, you can add: Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA

[PATCH v2] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-19 Thread John Hubbard
: Moritz Fischer Cc: linux-f...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, Changes since v1: Changed the label from "put_pages", to "unpin_pages". thanks, John Hubbard NVIDIA drivers/fpga/dfl-afu-dma-region.c | 19 +-- 1 file changed, 5 in

Re: [PATCH] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-19 Thread John Hubbard
On 2020-05-18 21:55, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. Lo

Re: [PATCH] tee: convert convert get_user_pages() --> pin_user_pages()

2020-05-19 Thread John Hubbard
On 2020-05-18 22:18, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. Lo

Re: [PATCH v5.5 10/10] mmap locking API: rename mmap_sem to mmap_lock

2020-05-19 Thread John Hubbard
etnaviv list can do some run time testing on the whole lot. [1] https://lore.kernel.org/r/20200519002124.2025955-3-jhubb...@nvidia.com [2] https://lore.kernel.org/r/20200518054315.2407093-1-jhubb...@nvidia.com thanks, -- John Hubbard NVIDIA

Re: [PATCH] fpga: dfl: afu: convert get_user_pages() --> pin_user_pages()

2020-05-19 Thread John Hubbard
On 2020-05-19 08:10, Xu Yilun wrote: ... @@ -72,7 +63,7 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, return 0; put_pages: How about we also change the tag to "unpin_pages"? Others look good to me. Sure, I'll send a v2 with that. thank

[PATCH] tee: convert convert get_user_pages() --> pin_user_pages()

2020-05-18 Thread John Hubbard
umit Semwal Cc: tee-...@lists.linaro.org Cc: linux-me...@vger.kernel.org Cc: dri-de...@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Signed-off-by: John Hubbard --- Note that I have only compile-tested this patch, although that does also include cross-compiling for a few other arches. thanks,

[PATCH] scsi: st: convert convert get_user_pages() --> pin_user_pages()

2020-05-18 Thread John Hubbard
] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ [3] https://lore.kernel.org/r/20190723153640.gb...@lst.de Cc: "Kai Mäkisara" Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: linux-s...@vge

[PATCH 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-18 Thread John Hubbard
arg. Also, if this series looks good, we can ask Souptick to change the name as well, to whatever the consensus is. My initial recommendation is: get_user_pages_fast_only(), to match the new pin_user_pages_only(). John Hubbard (4): mm/gup: move __get_user_pages_fast() down a few lines

[PATCH 4/4] drm/i915: convert get_user_pages() --> pin_user_pages()

2020-05-18 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- driv

[PATCH 3/4] mm/gup: introduce pin_user_pages_fast_only()

2020-05-18 Thread John Hubbard
This is the FOLL_PIN equivalent of __get_user_pages_fast(), except with a more descriptive name, and gup_flags instead of a boolean "write" in the argument list. Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 36 +++

[PATCH 2/4] mm/gup: refactor and de-duplicate gup_fast() code

2020-05-18 Thread John Hubbard
f enabling interrupts was fragile at best. Signed-off-by: John Hubbard --- include/linux/mm.h | 1 + mm/gup.c | 60 ++ 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index a5

[PATCH 1/4] mm/gup: move __get_user_pages_fast() down a few lines in gup.c

2020-05-18 Thread John Hubbard
This is in order to avoid a forward declaration of internal_get_user_pages_fast(), in the next patch. This is code movement only--all generated code should be identical. Signed-off-by: John Hubbard --- mm/gup.c | 112 +++ 1 file changed, 56

Re: [RFC] mm/gup.c: Use gup_flags as parameter instead of passing write flag

2020-05-18 Thread John Hubbard
full conversion in a single commit. But if it is not preferred way, I would go as per feedback. Thanks, I appreciate it! And yes, you'll want to do the "write" to "gup_flags" conversion in a single patch, definitely. thanks, -- John Hubbard NVIDIA

Re: [RFC] mm/gup.c: Use gup_flags as parameter instead of passing write flag

2020-05-18 Thread John Hubbard
with what I'm doing here. So, how would you like proceed? If you want to do the full conversion (which really should include the call sites), it would be easier for me if you based it on my upcoming small patchset, which I expect to post shortly (later today). thanks, -- John Hubbard NVIDIA

Re: [RFC V2] mm/vmstat: Add events for PMD based THP migration without split

2020-05-18 Thread John Hubbard
NFIG_ARCH_ENABLE_THP_MIGRATION + "thp_pmd_migration_success", + "thp_pmd_migration_failure", +#endif #endif #ifdef CONFIG_MEMORY_BALLOON "balloon_inflate", thanks, -- John Hubbard NVIDIA

Re: [PATCH] orangefs: convert get_user_pages() --> pin_user_pages()

2020-05-18 Thread John Hubbard
On 2020-05-17 23:01, John Hubbard wrote: This code was using get_user_pages*(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. Oops

[PATCH] orangefs: convert get_user_pages() --> pin_user_pages()

2020-05-18 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard ---

[PATCH] drm/etnaviv: convert get_user_pages() --> pin_user_pages()

2020-05-17 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- Hi, N

[PATCH] drivers/mic/scif: convert get_user_pages() --> pin_user_pages()

2020-05-17 Thread John Hubbard
[3] https://lore.kernel.org/r/20190723153640.gb...@lst.de Signed-off-by: John Hubbard --- Hi, Note that I have only compile-tested this patch, although that does also include cross-compiling for a few other arches. thanks, John Hubbard NVIDIA drivers/misc/mic/scif/scif_rma.c | 26

[PATCH] genwqe: convert get_user_pages() --> pin_user_pages()

2020-05-17 Thread John Hubbard
mann Cc: Greg Kroah-Hartman Signed-off-by: John Hubbard --- Hi, Note that I have only compile-tested this patch, although that does also include cross-compiling for a few other arches...but it only seemed to be supported on x86_64 and sparc, for those. thanks, John Hubbard NVIDIA drivers/misc/genw

[PATCH 0/2] mm/gup, media/ivtv: introduce pin_user_pages_unlocked

2020-05-17 Thread John Hubbard
, although that does also include cross-compiling for half a dozen arches. John Hubbard (2): mm/gup: introduce pin_user_pages_unlocked ivtv: convert get_user_pages() --> pin_user_pages() drivers/media/pci/ivtv/ivtv-udma.c | 19 ++- drivers/media/pci/ivtv/ivtv-yuv.c |

[PATCH 2/2] ivtv: convert get_user_pages() --> pin_user_pages()

2020-05-17 Thread John Hubbard
basically, this is a small part of fixing a long-standing disconnect between pinning pages, and file systems' use of those pages. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- dr

[PATCH 1/2] mm/gup: introduce pin_user_pages_unlocked

2020-05-17 Thread John Hubbard
Introduce pin_user_pages_unlocked(), which is nearly identical to the get_user_pages_unlocked() that it wraps, except that it sets FOLL_PIN and rejects FOLL_GET. Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 17 + 2 files changed, 19 insertions

[PATCH 0/2] rapidio: convert to pin_user_pages(), plus a small fix

2020-05-17 Thread John Hubbard
-compiling for half a dozen arches. John Hubbard (2): rapidio: fix an error in get_user_pages_fast() error handling rapidio: convert get_user_pages() --> pin_user_pages() drivers/rapidio/devices/rio_mport_cdev.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-)

[PATCH 1/2] rapidio: fix an error in get_user_pages_fast() error handling

2020-05-17 Thread John Hubbard
successfully pinned are released. Fixes: e8de370188d0 ("rapidio: add mport char device driver") Cc: Matt Porter Cc: Alexandre Bounine Cc: Sumit Semwal Cc: Dan Carpenter Cc: Andrew Morton Cc: linux-me...@vger.kernel.org Cc: sta...@vger.kernel.org Signed-off-by: John Hubbard --- drivers/rapid

[PATCH 2/2] rapidio: convert get_user_pages() --> pin_user_pages()

2020-05-17 Thread John Hubbard
lexandre Bounine Cc: Sumit Semwal Cc: Dan Carpenter Cc: Andrew Morton Cc: linux-me...@vger.kernel.org Signed-off-by: John Hubbard --- drivers/rapidio/devices/rio_mport_cdev.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/rapidio/devices/rio_mport_cdev.

<    1   2   3   4   5   6   7   8   9   10   >