Re: [PATCH] staging: kpc2000: Convert put_page() to put_user_page*()

2019-07-15 Thread John Hubbard
t;user_pages[i])) { - set_page_dirty(acd->user_pages[i]); - } - } - dma_unmap_sg(>ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir); - - for (i = 0 ; i < acd->page_count ; i++) { - put_page(acd->user_pages[i]); - } + put_user_pages_dirty(>user_pages[i], acd->page_count); sg_free_table(>sgt); (Also, Matt, I failed to Cc: you on a semi-related cleanup that I just sent out for this driver, as long as I have your attention: https://lore.kernel.org/r/20190715212123.432-1-jhubb...@nvidia.com ) thanks, -- John Hubbard NVIDIA

Re: [PATCH] staging: kpc2000: Convert put_page() to put_user_page*()

2019-07-15 Thread John Hubbard
On 7/15/19 3:01 PM, John Hubbard wrote: > On 7/15/19 2:47 PM, Matt Sickler wrote: ... > I agree: the PageReserved check looks unnecessary here, from my > outside-the-kpc_2000-team > perspective, anyway. Assuming that your analysis above is correct, you could > collapse tha

Re: [PATCH] staging: kpc2000: whitespace and line length cleanup

2019-07-15 Thread John Hubbard
On 7/15/19 3:21 PM, Joe Perches wrote: > On Mon, 2019-07-15 at 14:21 -0700, john.hubb...@gmail.com wrote: >> From: John Hubbard >> >> This commit was created by running indent(1): >> `indent -linux` >> >> ...and then applying some manual corrections an

Re: [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one

2019-07-15 Thread John Hubbard
truct page, which is odd, and also doesn't directly address the root cause, which I understand to be: this routine can't handle migrating the zero page properly--over and back, anyway. (We should also mention more about how this is triggered, in the commit description.) I'll take a closer look at possible fixes (I have to step out for a bit) soon, but any more experienced help is also appreciated here. thanks, -- John Hubbard NVIDIA

Re: [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one

2019-07-16 Thread John Hubbard
On 7/15/19 5:38 PM, Ralph Campbell wrote: On 7/15/19 4:34 PM, John Hubbard wrote: On 7/15/19 3:00 PM, Andrew Morton wrote: On Tue, 9 Jul 2019 18:24:57 -0700 Ralph Campbell wrote:   mm/rmap.c |    1 +   1 file changed, 1 insertion(+) --- a/mm/rmap.c~mm-hmm-fix-bad-subpage-pointer

Re: [PATCH] staging: kpc2000: whitespace and line length cleanup

2019-07-16 Thread John Hubbard
On 7/16/19 1:36 AM, Greg Kroah-Hartman wrote: > On Mon, Jul 15, 2019 at 02:21:23PM -0700, john.hubb...@gmail.com wrote: >> From: John Hubbard ... >> drivers/staging/kpc2000/kpc2000_i2c.c | 189 +++-- >> drivers/staging/kpc2000/kpc200

Re: [PATCH 1/3] mm: document zone device struct page reserved fields

2019-07-16 Thread John Hubbard
+* +* Also: the next three fields (mapping, index and +* private) are all used by ZONE_DEVICE pages. +*/ struct address_space *mapping; pgoff_t index;

Re: [PATCH 2/3] mm/hmm: fix ZONE_DEVICE anon page mapping reuse

2019-07-16 Thread John Hubbard
ZONE_DEVICE pages, migration is either +* handled differently or not done at all, so there is no need +* to clear page->mapping. +*/ if (is_device_private_page(page)) page->mapping = NULL; ? thanks, -- John Hubbard NVIDIA

Re: [PATCH 3/3] mm/hmm: Fix bad subpage pointer in try_to_unmap_one

2019-07-16 Thread John Hubbard
tly more confusing, and it was already pretty difficult to begin with. I still hold out hope for some comment documentation at least, and maybe even just removing the subpage variable (as Jerome mentioned, offline) as well. Jerome? thanks, -- John Hubbard NVIDIA

Re: [PATCH 1/3] mm: document zone device struct page reserved fields

2019-07-16 Thread John Hubbard
On 7/16/19 9:22 PM, Christoph Hellwig wrote: > On Tue, Jul 16, 2019 at 06:20:23PM -0700, John Hubbard wrote: >>> - unsigned long _zd_pad_1;/* uses mapping */ >>> + /* >>> +* The following fiel

Re: [RFC] mm: Proactive compaction

2019-09-17 Thread John Hubbard
ggering compaction? thanks, -- John Hubbard NVIDIA

Re: [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static

2019-09-10 Thread John Hubbard
On 9/8/19 12:16 AM, Linus Walleij wrote: On Sat, Sep 7, 2019 at 2:05 AM John Hubbard wrote: While building with !CONFIG_GPIOLIB, I experienced a build failure, because driver.h in that configuration supplies both a static and a non-static version of these routines: I think this is fixed

[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

[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] 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] 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,

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

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] 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] 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

[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: [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

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: [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] 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

[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

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

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: [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] 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: 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 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

[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 "

[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 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

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

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

[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

[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 2/2] vhost: convert get_user_pages() --> pin_user_pages()

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

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

2020-06-01 Thread John Hubbard
On 2020-06-01 03:35, Andy Shevchenko wrote: On Mon, Jun 1, 2020 at 1:00 AM John Hubbard wrote: On 2020-05-31 14:11, Andy Shevchenko wrote: ... JFYI, we have history.git starting from v0.01. OK, thanks for that note. According to that history.git [1], then: drivers/video/pvr2fb.c had

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

2020-06-01 Thread John Hubbard
On 2020-06-01 10:25, Andy Shevchenko wrote: On Mon, Jun 1, 2020 at 8:10 PM John Hubbard wrote: On 2020-06-01 03:35, Andy Shevchenko wrote: On Mon, Jun 1, 2020 at 1:00 AM John Hubbard wrote: On 2020-05-31 14:11, Andy Shevchenko wrote: ... JFYI, we have history.git starting from v0.01

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

2020-06-01 Thread John Hubbard
t your point is also important: maybe this patch should also be tracking other causes of THP PMD migration failure, in order to get a truer accounting of the situation. thanks, -- John Hubbard NVIDIA

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

[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.

[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 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

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

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: [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
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 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

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

[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

[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/

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

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] 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

[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 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
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
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

[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

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

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

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

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

[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

[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: 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 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

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

Re: [RFC PATCH 1/2] mm: introduce MAP_FIXED_SAFE

2017-11-17 Thread John Hubbard
implementation, I see a couple of things that might improve it slightly: a) Change MAP_FIXED_SAFE to MAP_NO_CLOBBER (as per Kees' idea), but keep the new flag independent, by omitting the above two lines. Instead of forcing MAP_FIXED as a result of the new flag, you could simply fail to take any a

Re: [RFC PATCH 0/2] mm: introduce MAP_FIXED_SAFE

2017-11-17 Thread John Hubbard
M (speaking loosely there--it's really any user space code that manages a unified memory address space, across devices) often ends up using MAP_FIXED, but MAP_FIXED crams several features into one flag: an exact address, an "atomic" switch to the new mapping, and unmapping the old mapp

[PATCH 0/1] lockdep: fix warning: print_lock_trace defined but not used

2019-05-21 Thread john . hubbard
From: John Hubbard Hi, This is a second attempt to send this. The first attempt [1] went via mailgw.nvidia.com, and did not receive a DKIM signature, so I think it probably got discarded by many systems. This one goes via gmail, which is what I was using before. We'll keep working on getting

[PATCH 1/1] lockdep: fix warning: print_lock_trace defined but not used

2019-05-21 Thread john . hubbard
From: John Hubbard Commit 0d2cc3b34532 ("locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING") moved the only usage of print_lock_trace() that was originally outside of the CONFIG_PROVE_LOCKING case. It moved that usage int

Re: [PATCH 5/5] mm/hmm: Fix mm stale reference use in hmm_free()

2019-05-23 Thread John Hubbard
tive. This is the basic pattern we used in ODP when working with mmu notifiers, I don't know why hmm would need to be different. +1 for the mmgrab() approach. I have never been able to see how these various checks can protect anything, and refcounting it into place definitely sounds like the right a

[PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread john . hubbard
From: John Hubbard For infiniband code that retains pages via get_user_pages*(), release those pages via the new put_user_page(), or put_user_pages*(), instead of put_page() This is a tiny part of the second step of fixing the problem described in [1]. The steps are: 1) Provide put_user_page

[PATCH 0/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread john . hubbard
From: John Hubbard Hi Jason and all, IIUC, now that we have the put_user_pages() merged in to linux.git, we can start sending up the callsite conversions via different subsystem maintainer trees. Here's one for linux-rdma. I've left the various Reviewed-by: and Tested-by: tags on here, even

Re: [PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread John Hubbard
hor: John Hubbard Date: Mon Mar 4 11:46:45 2019 -0800 RDMA/umem: minor bug fix in error handling path 1. Bug fix: fix an off by one error in the code that cleans up if it fails to dma-map a page, after having done a get_user_pages_remote() on a range of pa

Re: [PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread John Hubbard
e to me, do others have a preference on this? Last time we discussed it, I recall there was interest in trying to handle the sg lists, which was where a lot of focus was. I'm not sure if there was a preference one way or the other, on adding more of these helpers. thanks, -- John Hubbard NVIDIA

Re: [PATCH 3/5] mm/hmm: Use mm_get_hmm() in hmm_range_register()

2019-05-23 Thread John Hubbard
, that would violate the HMM API. Use mm_get_hmm() instead of hmm_get_or_create() to get the HMM structure. Signed-off-by: Ralph Campbell Cc: John Hubbard Cc: Ira Weiny Cc: Dan Williams Cc: Arnd Bergmann Cc: Balbir Singh Cc: Dan Carpenter Cc: Matthew Wilcox Cc: Souptick Joarder Cc: Andrew Morton

Re: [PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread John Hubbard
On 5/23/19 12:04 PM, Ira Weiny wrote: On Thu, May 23, 2019 at 10:46:38AM -0700, John Hubbard wrote: On 5/23/19 10:32 AM, Jason Gunthorpe wrote: On Thu, May 23, 2019 at 10:28:52AM -0700, Ira Weiny wrote: @@ -686,8 +686,8 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64

Re: [PATCH 1/1] infiniband/mm: convert put_page() to put_user_page*()

2019-05-23 Thread John Hubbard
above it seems like it would be a benefit to merge the 2 > call > paths more closely to make sure we do the right thing. > Yes, it does. Maybe best to not do the temporary measure, then, while this stuff gets improved. I'll look at your other patch... thanks, -- John Hubbard NVIDIA

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