Re: mmotm 2020-10-06-15-50 uploaded

2020-10-07 Thread John Hubbard
m and -next. [1] https://lore.kernel.org/dri-devel/f5130c7f-eebe-7b21-62b8-68f08212b...@nvidia.com [2] https://lore.kernel.org/r/f3c7f005b...@google.com thanks, -- John Hubbard NVIDIA

Re: [PATCH 05/13] mm/frame-vector: Use FOLL_LONGTERM

2020-10-07 Thread John Hubbard
pull the pup path out from the mmap_sem critical section as suggested by Jason. Signed-off-by: Daniel Vetter Cc: Jason Gunthorpe Cc: Pawel Osciak Cc: Marek Szyprowski Cc: Kyungmin Park Cc: Tomasz Figa Cc: Mauro Carvalho Chehab Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kar

Re: [PATCH 01/13] drm/exynos: Stop using frame_vector helpers

2020-10-07 Thread John Hubbard
On 10/7/20 2:32 PM, Daniel Vetter wrote: On Wed, Oct 7, 2020 at 10:33 PM John Hubbard wrote: On 10/7/20 9:44 AM, Daniel Vetter wrote: ... @@ -398,15 +399,11 @@ static void g2d_userptr_put_dma_addr(struct g2d_data *g2d, dma_unmap_sgtable(to_dma_dev(g2d->drm_dev), g2d_userptr-&

Re: [PATCH 06/13] media: videobuf2: Move frame_vector into media subsystem

2020-10-07 Thread John Hubbard
horpe Cc: Pawel Osciak Cc: Marek Szyprowski Cc: Kyungmin Park Cc: Tomasz Figa Cc: Mauro Carvalho Chehab Cc: Andrew Morton Cc: John Hubbard Cc: Jérôme Glisse Cc: Jan Kara Cc: Dan Williams Cc: linux...@kvack.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-samsung-...@vger.kernel.o

[PATCH] Documentation: filesystems: better locations for sysfs-pci, sysfs-tagging

2020-10-07 Thread John Hubbard
to be reading about filesystems in general and then come across these specific details about PCI, and tagging...and then back to general filesystems again. Move sysfs-pci and sysfs-tagging to a location under the sysfs topic. Signed-off-by: John Hubbard --- Hi, I'm not sure if the "to

Re: [PATCH 07/13] mm: close race in generic_access_phys

2020-10-07 Thread John Hubbard
something I'm sorta new to, so a newbie question: is it possible for the same pte to already be there, ever? If so, we be stuck in an infinite loop here. I'm sure that's not the case, but it's not yet obvious to me why it's impossible. Resource reservations maybe? thanks, -- John Hubbard NVIDIA

Re: [PATCH] Documentation: filesystems: better locations for sysfs-pci, sysfs-tagging

2020-10-08 Thread John Hubbard
On 10/8/20 9:04 AM, Jonathan Corbet wrote: On Wed, 7 Oct 2020 16:31:51 -0700 John Hubbard wrote: sysfs-pci and sysfs-tagging were mis-filed: their locations with Documentation/ implied that they were related to file systems. Actually, each topic is about a very specific *use* of sysfs, and

Re: [PATCH 1/4] mm: introduce vma_set_file function v2

2020-10-08 Thread John Hubbard
wrong, as it was already done within vma_set_file(). thanks, -- John Hubbard NVIDIA

[PATCH v2] Documentation: better locations for sysfs-pci, sysfs-tagging

2020-10-09 Thread John Hubbard
ff-by: John Hubbard --- Changes since v1: moved sysfs-pci to PCI, and sysfs-tagging to networking, and poked around in the generated HTML via Firefox. It looks like the right place now. thanks, John Hubbard NVIDIA Documentation/PCI/index.rst | 1 + Document

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
On 9/29/20 9:35 AM, Jason Gunthorpe wrote: On Mon, Sep 28, 2020 at 01:10:24PM -0700, John Hubbard wrote: On 9/28/20 5:57 AM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 11:21:53PM -0700, John Hubbard wrote: diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
On 9/29/20 10:55 AM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 10:44:31AM -0700, John Hubbard wrote: On 9/29/20 9:35 AM, Jason Gunthorpe wrote: On Mon, Sep 28, 2020 at 01:10:24PM -0700, John Hubbard wrote: On 9/28/20 5:57 AM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 11:21:53PM

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
On 9/29/20 12:08 PM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 11:59:55AM -0700, John Hubbard wrote: On 9/29/20 10:55 AM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 10:44:31AM -0700, John Hubbard wrote: On 9/29/20 9:35 AM, Jason Gunthorpe wrote: On Mon, Sep 28, 2020 at 01:10:24PM

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
tests and doesn't break workflow for developers. Do you have a link or two for that? Especially about the pushback, and conclusions reached, if any. thanks, -- John Hubbard NVIDIA

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
On 9/29/20 1:20 PM, Shuah Khan wrote: On 9/29/20 2:11 PM, John Hubbard wrote: ... Do you have a link or two for that? Especially about the pushback, and conclusions reached, if any. Unfortunately no. A I recall it was workflow related issues and ease of running individual subsystem tests

[PATCH v2 4/8] selftests/vm: minor cleanup: Makefile and gup_test.c

2020-09-29 Thread John Hubbard
s rid of one special rule already. Signed-off-by: John Hubbard --- tools/testing/selftests/vm/Makefile | 10 -- tools/testing/selftests/vm/gup_test.c | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftes

[PATCH v2 7/8] selftests/vm: run_vmtest.sh: update and clean up gup_test invocation

2020-09-29 Thread John Hubbard
Run benchmarks on the _fast variants of gup and pup, as originally intended. Run the new gup_test sub-test: dump pages. In addition to exercising the dump_page() call, it also demonstrates the various options you can use to specify which pages to dump, and how. Signed-off-by: John Hubbard

[PATCH v2 6/8] selftests/vm: gup_test: introduce the dump_pages() sub-test

2020-09-29 Thread John Hubbard
use THP pages -F 1:use pin_user_pages() instead of get_user_pages() 0 19 0x1000: dump pages 0, 19, and 4096 Signed-off-by: John Hubbard --- mm/Kconfig| 6 +++ mm/gup_test.c | 54 ++- mm/gup_test.h

[PATCH v2 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency

2020-09-29 Thread John Hubbard
iles, one for inclusion in hmm-test.c (local_config.h), and one for inclusion in the Makefile (local_config.mk). Cc: Ralph Campbell Signed-off-by: John Hubbard --- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile| 24 +++-- tools/testin

[PATCH v2 5/8] selftests/vm: only some gup_test items are really benchmarks

2020-09-29 Thread John Hubbard
hat no one reasonably needs to check. 3. Don't do iterations, for non-benchmark items. 4. Print out a shorter, more appropriate report for the non-benchmark tests. 5. Add the command that was run, to the report. This really helps, as there are quite a lot of options now. Signed-off-b

[PATCH v2 1/8] mm/gup_benchmark: rename to mm/gup_test

2020-09-29 Thread John Hubbard
importantly, however, subsequent patches are about to add some functionality that is non-benchmark related. Closely related changes: * Kconfig: in addition to renaming the options from GUP_BENCHMARK to GUP_TEST, update the help text to reflect that it's no longer a benchmark-only test. Si

[PATCH v2 0/8] selftests/vm: gup_test, hmm-tests, assorted improvements

2020-09-29 Thread John Hubbard
mm-tests, if libhugetlbfs is not available. Further details in the commit description of patch #8. Other smaller things that this series does: a) Remove code duplication by creating gup_test.h. b) Clear up the sub-test organization, and their invocation within run_vmtests.sh. c) Other minor asso

[PATCH v2 3/8] selftests/vm: rename run_vmtests --> run_vmtests.sh

2020-09-29 Thread John Hubbard
Rename to *.sh, in order to match the conventions of all of the other items in selftest/vm. The only reason not to use a .sh suffix a shell script like this, might be to make it look more like a normal program, but that's not an issue here. Signed-off-by: John Hubbard --- tools/te

[PATCH v2 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread John Hubbard
this low-level, kernel-developer-oriented selftests/vm system is very much not subject to ABI stability. So "expansion" and "reserved" fields are unnecessary here. Signed-off-by: John Hubbard --- mm/gup_test.c | 17 +---

Re: [PATCH 1/4] mm: introduce vma_set_file function v2

2020-10-09 Thread John Hubbard
On 10/9/20 12:33 AM, Christian König wrote: Am 08.10.20 um 23:49 schrieb John Hubbard: On 10/8/20 4:23 AM, Christian König wrote: ... diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 3d69e51f3e4d..c9d5f1a38af3 100644 --- a/drivers/gpu/drm

Re: [PATCH RFC PKS/PMEM 57/58] nvdimm/pmem: Stray access protection for pmem->virt_addr

2020-10-09 Thread John Hubbard
ds like a clumsy API design to *disable*, right?). And there is no hint about the scope. And it *could* be so much more readable like this: dev_access_enable(DEV_ACCESS_THIS_THREAD); thanks, -- John Hubbard NVIDIA

[PATCH 1/8] mm/gup_benchmark: rename to mm/gup_test

2020-09-27 Thread John Hubbard
importantly, however, subsequent patches are about to add some functionality that is non-benchmark related. Closely related changes: * Kconfig: in addition to renaming the options from GUP_BENCHMARK to GUP_TEST, update the help text to reflect that it's no longer a benchmark-only test. Si

[PATCH 5/8] selftests/vm: only some gup_test items are really benchmarks

2020-09-27 Thread John Hubbard
hat no one reasonably needs to check. 3. Don't do iterations, for non-benchmark items. 4. Print out a shorter, more appropriate report for the non-benchmark tests. 5. Add the command that was run, to the report. This really helps, as there are quite a lot of options now. Signed-off-b

[PATCH 7/8] selftests/vm: run_vmtest.sh: update and clean up gup_test invocation

2020-09-27 Thread John Hubbard
Run benchmarks on the _fast variants of gup and pup, as originally intended. Run the new gup_test sub-test: dump pages. In addition to exercising the dump_page() call, it also demonstrates the various options you can use to specify which pages to dump, and how. Signed-off-by: John Hubbard

[PATCH 3/8] selftests/vm: rename run_vmtests --> run_vmtests.sh

2020-09-27 Thread John Hubbard
Rename to *.sh, in order to match the conventions of all of the other items in selftest/vm. The only reason not to use a .sh suffix a shell script like this, might be to make it look more like a normal program, but that's not an issue here. Signed-off-by: John Hubbard --- tools/te

[PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency

2020-09-27 Thread John Hubbard
iles, one for inclusion in hmm-test.c (local_config.h), and one for inclusion in the Makefile (local_config.mk). Cc: Ralph Campbell Signed-off-by: John Hubbard --- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile| 24 +++-- tools/testin

[PATCH 0/8] selftests/vm: gup_test, hmm-tests, assorted improvements

2020-09-27 Thread John Hubbard
gup_test.h. b) Clear up the sub-test organization, and their invocation within run_vmtests.sh. c) Other minor assorted improvements. John Hubbard (8): mm/gup_benchmark: rename to mm/gup_test selftests/vm: use a common gup_test.h selftests/vm: rename run_vmtests --> run_vmtests.sh selftests

[PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-27 Thread John Hubbard
this low-level, kernel-developer-oriented selftests/vm system is very much not subject to ABI stability. So "expansion" and "reserved" fields are unnecessary here. Signed-off-by: John Hubbard --- mm/gup_test.c | 17 +---

[PATCH 4/8] selftests/vm: minor cleanup: Makefile and gup_test.c

2020-09-27 Thread John Hubbard
uding, soon, gup_test.c. This gets rid of one special rule already. Signed-off-by: John Hubbard --- tools/testing/selftests/vm/Makefile | 10 -- tools/testing/selftests/vm/gup_test.c | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/vm/Makefi

[PATCH 6/8] selftests/vm: gup_test: introduce the dump_pages() sub-test

2020-09-27 Thread John Hubbard
use THP pages -F 1:use pin_user_pages() instead of get_user_pages() 0 19 0x1000: dump pages 0, 19, and 4096 Also, invoke the new test from run_vmtests.sh. This keeps it in use, and also provides a good example of how to invoke it. Signed-off-by: John

Re: [PATCH 7/8] selftests/vm: run_vmtest.sh: update and clean up gup_test invocation

2020-09-28 Thread John Hubbard
On 9/28/20 12:26 PM, Ira Weiny wrote: On Sun, Sep 27, 2020 at 11:21:58PM -0700, John Hubbard wrote: ... +echo "--" +echo "running gup_test -ct -F 0x1 0 19 0x1000" +echo " Dumps pages 0, 19, and 4096, usi

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-28 Thread John Hubbard
On 9/28/20 5:57 AM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 11:21:53PM -0700, John Hubbard wrote: diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index d1ae706d9927..9cc6bc087461 100644 +++ b/tools/testing/selftests/vm/Makefile @@ -130,3 +130,5

Re: [PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency

2020-09-28 Thread John Hubbard
On 9/28/20 6:02 AM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 11:21:59PM -0700, John Hubbard wrote: ... +gcc -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1 This gcc has to come from some makefile variable ahem, yes, that really should have just been $(CC), will change to that.

Re: [PATCH 8/8] selftests/vm: hmm-tests: remove the libhugetlbfs dependency

2020-09-28 Thread John Hubbard
On 9/28/20 1:18 PM, John Hubbard wrote: On 9/28/20 6:02 AM, Jason Gunthorpe wrote: On Sun, Sep 27, 2020 at 11:21:59PM -0700, John Hubbard wrote: ... +gcc -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1 This gcc has to come from some makefile variable I plan on posting a v2

Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned

2020-09-28 Thread John Hubbard
L_LONGTERM call sites were at least potentially special, despite the spirited debates in at least two conferences about the meaning and implications of "long term". :) And here we are seeing an example of such a special case, which I think is natural enough. thanks, -- John Hubbard NVIDIA

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

2020-05-29 Thread John Hubbard
x27;s time.) 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

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

2020-05-29 Thread John Hubbard
for quite a few patches 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] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
890 return 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

[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

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

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

2020-05-29 Thread John Hubbard
t of view. It would 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

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

2020-05-29 Thread John Hubbard
does also 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(

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

2020-05-29 Thread John Hubbard
07108/ Cc: 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

[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

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

2020-05-25 Thread John Hubbard
MASK; addr = start; Yes, looks 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 v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory

2020-05-25 Thread John Hubbard
e multiple guests running: if guest A attempts + * get_user_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

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

2020-05-25 Thread John Hubbard
Wu Hao Cc: 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 handlin

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

2020-05-25 Thread John Hubbard
der Cc: Sumit 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 Hubb

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

2020-05-25 Thread John Hubbard
ally, 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 Hubba

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

2020-05-25 Thread John Hubbard
the commit log, but not quite appropriate in mm.h, yes. thanks, -- John Hubbard NVIDIA

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

2020-05-25 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..9693d

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

2020-05-25 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 u

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

2020-05-25 Thread John Hubbard
av 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 Signed-off-by: John Hubbard --- arch/x86/kvm/svm/sev.c | 6 +++--- 1 file changed

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

2020-05-25 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

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

2020-05-26 Thread John Hubbard
quot;) 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: [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

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

2020-05-26 Thread John Hubbard
Cc: Martin K. 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

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

2020-05-26 Thread John Hubbard
() has a few more situations (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

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

2020-05-26 Thread John Hubbard
t/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 help is much appriciated. --- drivers/gpu/drm/radeon/radeon_ttm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dri

Re: [PATCH hmm v2 2/5] mm/hmm: make hmm_range_fault return 0 or -1

2020-05-04 Thread John Hubbard
>= are still at their input * values. */ Either way, Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA } while (ret == -EBUSY); - - if (ret) - return ret; - return (hmm_vma_walk.last - range->start)

Re: [PATCH hmm v2 4/5] mm/hmm: remove HMM_PFN_SPECIAL

2020-05-04 Thread John Hubbard
On 2020-05-01 11:20, Jason Gunthorpe wrote: From: Jason Gunthorpe This is just an alias for HMM_PFN_ERROR, nothing cares that the error was because of a special page vs any other error case. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA Acked-by: Felix Kuehling Reviewed-by

Re: [PATCH hmm v2 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault

2020-05-04 Thread John Hubbard
N_VALID]; + return pmd_write(pmd) ? (HMM_PFN_VALID | HMM_PFN_WRITE) : HMM_PFN_VALID; I always found the previous range->flags[...] approach hard to remember, so it's nice to see a simpler version now. thanks, -- John Hubbard NVIDIA

Re: [RFC] mm/gup.c: Updated return value of {get|pin}_user_pages_fast()

2020-05-05 Thread John Hubbard
len))) return -EFAULT; ...although I might be missing some other things that need a similar change, so you should look carefully for yourself. Once that change (and anything I missed) is in place, then you could go ahead and stop handling ret==0 cases at the call sites. thanks, --

Re: [RFC] mm/gup.c: Updated return value of {get|pin}_user_pages_fast()

2020-05-05 Thread John Hubbard
On 2020-05-05 13:36, Souptick Joarder wrote: On Wed, May 6, 2020 at 1:08 AM John Hubbard wrote: On 2020-05-05 12:14, Souptick Joarder wrote: Currently {get|pin}_user_pages_fast() have 3 return value 0, -errno and no of pinned pages. The only case where these two functions will return 0, is

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

2020-06-01 Thread John Hubbard
, Documentation/vm/page_migration.rst ? thanks, -- John Hubbard NVIDIA

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 0/2] video: fbdev: fix error handling, convert to pin_user_pages*()

2020-05-21 Thread John Hubbard
ergmann Cc: Daniel 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()

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

2020-05-21 Thread John Hubbard
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/fbdev/pvr2fb.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/

[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 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 v2 4/4] drm/i915: convert get_user_pages() --> pin_user_pages()

2020-05-21 Thread John Hubbard
ally, 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 v2 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages()

2020-05-21 Thread John Hubbard
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 in gup.c mm/gup: refactor and de-dupli

[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
orm of 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 ind

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

2020-05-22 Thread John Hubbard
based 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 1/1] vfio/spapr_tce: convert get_user_pages() --> pin_user_pages()

2020-05-22 Thread John Hubbard
mson Cc: 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 dele

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_pages(

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

2020-05-22 Thread John Hubbard
Cc: Martin 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

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 it

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-

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 is

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

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

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

2020-05-14 Thread John Hubbard
ermore depend on today's exact code. Maybe Zi Yan's recommended name is exactly right, in fact: THP_PMD_MIGRATION_SUCCESS thanks, -- John Hubbard NVIDIA 2. With split pgmigrate_success 512 pgmigrate_fail 0 thp_pmd_migration

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

2020-06-08 Thread John Hubbard
On 2020-06-08 12:01, Souptick Joarder wrote: On Mon, Jun 1, 2020 at 7:15 AM John Hubbard wrote: On 2020-05-31 10:51, Souptick Joarder wrote: In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred

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

2020-06-08 Thread John Hubbard
On 2020-06-08 12:16, Dan Carpenter wrote: On Mon, Jun 08, 2020 at 12:05:57PM -0700, John Hubbard wrote: On 2020-06-08 12:01, Souptick Joarder wrote: On Mon, Jun 1, 2020 at 7:15 AM John Hubbard wrote: On 2020-05-31 10:51, Souptick Joarder wrote: In 2019, we introduced pin_user_pages*() and

[PATCH v2 0/3] bio: Direct IO: convert to pin_user_pages_fast()

2020-08-29 Thread John Hubbard
4061750.ga19...@infradead.org/ [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ John Hubbard (3): mm/gup: introduce pin_user_page() iov_iter: introduce iov_iter_pin_user_pages*() routines bio: convert get_user_pages_fast() --> pin_user_pages_fast(

[PATCH v2 2/3] iov_iter: introduce iov_iter_pin_user_pages*() routines

2020-08-29 Thread John Hubbard
rementally change Direct IO callers from calling get_user_pages_fast() and put_page(), over to calling pin_user_pages_fast() and unpin_user_page(), there need to be mid-level routines that specifically call one or the other systems, for both page acquisition and page release. Signed-off-by: Jo

[PATCH v2 3/3] bio: convert get_user_pages_fast() --> pin_user_pages_fast()

2020-08-29 Thread John Hubbard
uot;Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: John Hubbard --- block/bio.c | 24 block/blk-map.c | 6 +++--- fs/direct-io.c | 28 ++-- fs/iomap/direct-io.c | 2 +- 4

[PATCH v2 1/3] mm/gup: introduce pin_user_page()

2020-08-29 Thread John Hubbard
. [1] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ [2] Documentation/core-api/pin_user_pages.rst Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c | 30 ++ 2 files changed, 32 insertions(+) diff

Re: [PATCH] mm/gup: don't permit users to call get_user_pages with FOLL_LONGTERM

2020-09-03 Thread John Hubbard
On 9/3/20 12:12 AM, Souptick Joarder wrote: On Wed, Aug 19, 2020 at 11:45 PM John Hubbard wrote: On 8/19/20 4:01 AM, Barry Song wrote: gug prohibits users from calling get_user_pages() with FOLL_PIN. But it Maybe Andrew can fix the typo above: gug --> gup. allows users to c

Re: [PATCH 16/38] media: videobuf-dma-sg: number of pages should be unsigned long

2020-09-03 Thread John Hubbard
_fast((unsigned long)src_ptr, nr_pages, 0, pages); ...in other words, check the value while it's stored in a 64-bit type, before sending it down into a 32-bit API. ...other than that, everything else looks fine. thanks, -- John Hubbard NVIDIA

Re: [GIT PULL] tee subsystem pin_user_pages for v5.8

2020-08-24 Thread John Hubbard
On 8/23/20 11:51 PM, Jens Wiklander wrote: On Fri, Aug 21, 2020 at 11:19 PM Olof Johansson wrote: On Fri, Aug 21, 2020 at 12:58 PM John Hubbard wrote: On 8/21/20 11:49 AM, Olof Johansson wrote: On Tue, May 26, 2020 at 03:12:59PM +0200, Jens Wiklander wrote: Hello arm-soc maintainers

Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

2020-08-24 Thread John Hubbard
On 8/22/20 11:57 PM, John Hubbard wrote: On 8/22/20 11:25 PM, Christoph Hellwig wrote: On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote: Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field was full, thuse triggering an expansion of the field from 16,

Re: [PATCH 5/5] fs/ceph: use pipe_get_pages_alloc() for pipe

2020-08-24 Thread John Hubbard
ld be great to go in via the ceph tree. For the main series here, I'll send a v2 with only patches 1-3, once enough feedback has happened. thanks, -- John Hubbard NVIDIA

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

2020-08-24 Thread John Hubbard
der Cc: Sumit 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 --- OK, this should be indentical to v1 [1], but now rebased against Linux 5.9-rc2. As before, I've compile-tested it agai

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

2020-08-24 Thread John Hubbard
On 8/24/20 11:36 AM, 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.

<    3   4   5   6   7   8   9   10   11   >