Re: [PATCH 5/5] mm/thp: Split huge pmds/puds if they're pinned when fork()

2020-09-22 Thread John Hubbard
like if you could do a check near the beginning of this routine, and handle it there, with less unwinding? In fact, after taking only the src_ptl, the check could be made, right? thanks, -- John Hubbard NVIDIA

Re: [PATCH 4/5] mm: Do early cow for pinned pages during fork() for ptes

2020-09-21 Thread John Hubbard
On 9/21/20 3:27 PM, Jann Horn wrote: On Tue, Sep 22, 2020 at 12:18 AM John Hubbard wrote: On 9/21/20 2:55 PM, Jann Horn wrote: On Mon, Sep 21, 2020 at 11:20 PM Peter Xu wrote: ... Ah... the documentation you linked implies that FOLL_WRITE should more or less imply FOLL_PIN? I didn't

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

2020-09-21 Thread John Hubbard
On 9/21/20 4:53 PM, John Hubbard wrote: On 9/21/20 2:17 PM, Peter Xu wrote: (Commit message collected from Jason Gunthorpe) Reduce the chance of false positive from page_maybe_dma_pinned() by keeping Not yet, it doesn't. :)  More: track if the mm_struct has ever been used

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

2020-09-21 Thread John Hubbard
miss the opportunity to make it a tiny bit cleaner to the reader. thanks, -- John Hubbard NVIDIA

Re: [PATCH 4/5] mm: Do early cow for pinned pages during fork() for ptes

2020-09-21 Thread John Hubbard
_user_pages*() side of it. But the pin count will need to remain, in order to discern between DMA pins and temporary refcount boosts. thanks, -- John Hubbard NVIDIA

Re: [PATCH] misc: mic: scif: Fix error handling path

2020-09-20 Thread John Hubbard
: Souptick Joarder Cc: John Hubbard Cc: Ira Weiny Cc: Dan Carpenter --- Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA drivers/misc/mic/scif/scif_rma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic

Re: [PATCH] mm/gup: protect unpin_user_pages() against npages==-ERRNO

2020-09-19 Thread John Hubbard
On 9/19/20 8:03 PM, Souptick Joarder wrote: On Thu, Sep 17, 2020 at 1:11 PM Dan Carpenter wrote: On Wed, Sep 16, 2020 at 11:57:06PM -0700, John Hubbard wrote: As suggested by Dan Carpenter, fortify unpin_user_pages() just a bit, against a typical caller mistake: check if the npages arg

Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

2020-09-18 Thread John Hubbard
I think we're getting closer to using it. There was a recent attempt at using this stuff, from Chris Wilson. [1] [1] https://lore.kernel.org/intel-gfx/20200624191417.16735-1-chris%40chris-wilson.co.uk/ thanks, -- John Hubbard NVIDIA

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-18 Thread John Hubbard
On 9/17/20 7:21 PM, Souptick Joarder wrote: On Thu, Sep 17, 2020 at 11:17 PM John Hubbard wrote: ... I sort of feel like returning partial successes is not working. We could easily make a wrapper which either pins everything or it returns an error code. Yes we could. And I have the same

Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

2020-09-17 Thread John Hubbard
page pinning event done on it". We'd have to give up pin_user_pages_fast() to do that as we can't fast walk and get vmas? oops, yes. I'd forgotten about that point. Basically all of the O_DIRECT callers need _fast. This is a big problem. thanks, -- John Hubbard NVIDIA Hmm, there are man

Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

2020-09-17 Thread John Hubbard
out the need to ever clear that flag. That *seems* reasonable, based on the use cases for these kinds of pages. 2) And then rename: page_maybe_dma_pinned() --> page_likely_dma_pinned() :) thanks, -- John Hubbard NVIDIA

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread John Hubbard
to the simpler API. There are more than enough gup/pup API entry points as it is, that's for sure. thanks, -- John Hubbard NVIDIA

[PATCH] mm/gup: protect unpin_user_pages() against npages==-ERRNO

2020-09-17 Thread John Hubbard
pinned), but probably not. More likely, gup/pup returned a hard -ERRNO error to the caller, who erroneously passed it here. Cc: Ira Weiny Cc: Souptick Joarder Signed-off-by: Dan Carpenter Signed-off-by: John Hubbard --- Hi Dan, Is is OK to use your signed-off-by here? Since you came up

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread John Hubbard
r") Signed-off-by: Souptick Joarder Cc: Ira Weiny Cc: John Hubbard Cc: Matthew Wilcox --- drivers/rapidio/devices/rio_mport_cdev.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio

Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

2020-09-15 Thread John Hubbard
quot;definitely not DMA-pinned", via this API call: static inline bool page_maybe_dma_pinned(struct page *page) ...which does *not* always use GUP_PIN_COUNTING_BIAS to provide that answer. thanks, -- John Hubbard NVIDIA

Re: [PATCH v2] mm/gup: fix gup_fast with dynamic page table folding

2020-09-15 Thread John Hubbard
a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code") Reviewed-by: Gerald Schaefer Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik --- Looks cleaner than I'd dared hope for. :) Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA v2: added brac

[PATCH 0/2] selftests/vm: fix some minor aggravating factors in the Makefile

2020-09-14 Thread John Hubbard
serfaultfd # ...userfaultfd fails to link, due to incomplete LDLIBS That's what Patch 0002 fixes. John Hubbard (2): selftests/vm: fix false build success on the second and later attempts selftests/vm: fix incorrect gcc invocation in some cases tools/testing/selftests/vm/Makefile | 17 ++

[PATCH 1/2] selftests/vm: fix false build success on the second and later attempts

2020-09-14 Thread John Hubbard
believing that there's nothing else to build. Fix this by telling Make to delete targets that didn't completely succeed. Signed-off-by: John Hubbard --- tools/testing/selftests/vm/Makefile | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/vm/Makefile b/too

[PATCH 2/2] selftests/vm: fix incorrect gcc invocation in some cases

2020-09-14 Thread John Hubbard
despite using incorrect values such as an *occasionally* incomplete LDLIBS value. Signed-off-by: John Hubbard --- tools/testing/selftests/vm/Makefile | 12 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 9f2625bebf07..3

Re: [PATCH] mm/gup.c: Handling ERR within unpin_user_pages()

2020-09-14 Thread John Hubbard
fix up the callers. thanks, -- John Hubbard NVIDIA

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-10 Thread John Hubbard
On 9/10/20 3:11 PM, Jason Gunthorpe wrote: On Thu, Sep 10, 2020 at 02:22:37PM -0700, John Hubbard wrote: Or am I way off here, and it really is possible (aside from the current s390 situation) to observe something that "is no longer a page table"? Yes, that is the issue

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-10 Thread John Hubbard
e unstable. Even if pXd_none()==true. Or am I way off here, and it really is possible (aside from the current s390 situation) to observe something that "is no longer a page table"? thanks, -- John Hubbard NVIDIA

Re: [RFC PATCH 00/16] 1GB THP support on x86_64

2020-09-08 Thread John Hubbard
ture flags itself, I'd lean toward making it its own new syscall, maybe: compact_huge_pages(nbytes or npages, flags /* page size, etc */); ...thus leaving madvise() and it's remaining flags still available, to further refine things. thanks, -- John Hubbard NVIDIA

Re: [linux-next PATCH v4] drivers/virt/fsl_hypervisor: Fix error handling path

2020-09-04 Thread John Hubbard
On 9/4/20 6:16 PM, Souptick Joarder wrote: Hi Andrew, On Wed, Sep 2, 2020 at 3:00 AM John Hubbard wrote: On 9/1/20 2:21 PM, Souptick Joarder wrote: First, when memory allocation for sg_list_unaligned failed, there is a bug of calling put_pages() as we haven't pinned any pages. Second

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

2020-09-03 Thread John Hubbard
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: [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: [RFC PATCH 0/2] mm/gup: fix gup_fast with dynamic page table folding

2020-09-01 Thread John Hubbard
, pte) static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep , pte_t pte) { native_set_pte(ptep, pte); } This type of abstraction has worked out very well, IMHO. thanks, -- John Hubbard NVIDIA

Re: [linux-next PATCH v4] drivers/virt/fsl_hypervisor: Fix error handling path

2020-09-01 Thread John Hubbard
of these changes, minor update in documentation. Fixes: 6db7199407ca ("drivers/virt: introduce Freescale hypervisor management driver") Signed-off-by: Souptick Joarder Reviewed-by: Dan Carpenter Reviewed-by: John Hubbard --- This looks good to me. thanks, -- John Hubbard NVIDIA v2: Added

Re: [linux-next PATCH v3] drivers/virt/fsl_hypervisor: Fix error handling path

2020-09-01 Thread John Hubbard
On 9/1/20 1:14 PM, Souptick Joarder wrote: Hi John, On Tue, Sep 1, 2020 at 4:28 AM John Hubbard wrote: On 8/31/20 3:07 PM, Souptick Joarder wrote: First, when memory allocation for sg_list_unaligned failed, there is a bug of calling put_pages() as we haven't pinned any pages. "we s

Re: [linux-next PATCH v3] drivers/virt/fsl_hypervisor: Fix error handling path

2020-08-31 Thread John Hubbard
Reviewed-by: John Hubbard Few questions -> First, there are minor updates from v2 -> v3 other than addressing your review comments in v2. Would you like to review it again? I reviewed it again. Second, I think, as per Documentation/core-api/pin_user_pages.rst, this is case

Re: [linux-next PATCH v3] drivers/virt/fsl_hypervisor: Fix error handling path

2020-08-31 Thread John Hubbard
ut that's beyond the scope of your work here. thanks, -- John Hubbard NVIDIA

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

2020-08-31 Thread John Hubbard
On 8/31/20 9:52 AM, Ira Weiny wrote: On Mon, Aug 31, 2020 at 12:14:39AM -0700, John Hubbard wrote: @@ -1113,8 +1113,8 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) } else { if (is_bvec) ret

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

2020-08-31 Thread John Hubbard
ady done there. [1] https://lore.kernel.org/kvm/20190724061750.ga19...@infradead.org/ [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ John Hubbard (3): mm/gup: introduce pin_page() iov_iter: introduce iov_iter_pin_pages*() routines

[PATCH v3 1/3] mm/gup: introduce pin_page()

2020-08-31 Thread John Hubbard
to pin_user_page*() and unpin_user_page*(). [1] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ [2] Documentation/core-api/pin_user_pages.rst Cc: Christoph Hellwig Signed-off-by: John Hubbard --- include/linux/mm.h | 2 ++ mm/gup.c

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

2020-08-31 Thread John Hubbard
...@infradead.org/ [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: John Hubbard --- block/bio.c | 24 block/blk-map.c | 6 +++--- fs/direct-io.c

[PATCH v3 2/3] iov_iter: introduce iov_iter_pin_pages*() routines

2020-08-31 Thread John Hubbard
c: Al Viro Signed-off-by: John Hubbard --- include/linux/uio.h | 5 ++ lib/iov_iter.c | 113 2 files changed, 110 insertions(+), 8 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index 3835a8a8e9ea..e44eed12afdf 100644 ---

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

2020-08-30 Thread John Hubbard
are definitely welcome here. thanks, -- John Hubbard NVIDIA

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

2020-08-29 Thread John Hubbard
the BIO. Nit: the ant and the will still fit on the previous line. Sorry about that, *usually* my text editor does the Right Thing for those, I must have interfered with the natural flow of things. :) thanks, -- John Hubbard NVIDIA

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

2020-08-29 Thread John Hubbard
On 8/29/20 7:58 AM, Christoph Hellwig wrote: On Sat, Aug 29, 2020 at 01:08:52AM -0700, John Hubbard wrote: ... @@ -1280,7 +1281,11 @@ static inline ssize_t __pipe_get_pages(struct iov_iter *i, maxsize = n; n += *start; while (n > 0) { - get_page(*pa

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

2020-08-29 Thread John Hubbard
On 8/29/20 7:54 AM, Christoph Hellwig wrote: On Sat, Aug 29, 2020 at 01:08:51AM -0700, John Hubbard wrote: pin_user_page() is the FOLL_PIN equivalent of get_page(). This was always a missing piece of the pin/unpin API calls (early reviewers of pin_user_pages() asked about it, in fact

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

2020-08-29 Thread John Hubbard
] "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 --git

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

2020-08-29 Thread John Hubbard
"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() block/bio.c | 24

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

2020-08-29 Thread John Hubbard
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 files changed, 30 insertions(+), 30

[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

Re: [bio] 37abbdc72e: WARNING:at_block/bio.c:#bio_release_pages

2020-08-26 Thread John Hubbard
LL_PIN is not going to happen, but it's good to see that the system isn't doing anything unexpected here. thanks, -- John Hubbard NVIDIA kern :warn : [ 59.774973] blk_update_request+0x219/0x3c0 kern :warn : [ 59.775767] scsi_end_request+0x29/0x140 kern :warn : [ 59.

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

2020-08-25 Thread John Hubbard
On 8/25/20 1:32 AM, Jens Wiklander wrote: On Mon, Aug 24, 2020 at 02:11:25PM -0700, John Hubbard wrote: ... OK, one more try, this time actually handling the _USER_MAPPED vs. _KERNEL_MAPPED pages! thanks, John Hubbard NVIDIA Looks good and it works too! :-) I've tested it on my Hikey board

Re: [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast()

2020-08-24 Thread John Hubbard
On 8/24/20 7:22 PM, Al Viro wrote: On Mon, Aug 24, 2020 at 07:07:02PM -0700, John Hubbard wrote: On 8/24/20 6:54 PM, Al Viro wrote: On Fri, Aug 21, 2020 at 09:20:54PM -0700, John Hubbard wrote: Direct IO behavior: ITER_IOVEC: pin_user_pages_fast(); break

Re: [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast()

2020-08-24 Thread John Hubbard
On 8/24/20 7:07 PM, Al Viro wrote: On Tue, Aug 25, 2020 at 02:54:28AM +0100, Al Viro wrote: On Fri, Aug 21, 2020 at 09:20:54PM -0700, John Hubbard wrote: Direct IO behavior: ITER_IOVEC: pin_user_pages_fast(); break; ITER_KVEC:// already elevated page refcount

Re: [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast()

2020-08-24 Thread John Hubbard
On 8/24/20 6:54 PM, Al Viro wrote: On Fri, Aug 21, 2020 at 09:20:54PM -0700, John Hubbard wrote: Direct IO behavior: ITER_IOVEC: pin_user_pages_fast(); break; ITER_KVEC:// already elevated page refcount, leave alone ITER_BVEC:// already elevated page

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

2020-08-24 Thread John Hubbard
. Signed-off-by: John Hubbard --- OK, here's a v2 that does EXPORT_SYMBOL_GPL, instead of EXPORT_SYMBOL, that's the only change from v1. That should help give this patch a clear bill of passage. :) thanks, John Hubbard NVIDIA fs/ceph/file.c | 3 +-- include/linux/uio.h | 3 ++- lib

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

2020-08-24 Thread John Hubbard
ernel.org Cc: dri-de...@lists.freedesktop.org Cc: linaro-mm-...@lists.linaro.org Signed-off-by: John Hubbard --- OK, one more try, this time actually handling the _USER_MAPPED vs. _KERNEL_MAPPED pages! thanks, John Hubbard NVIDIA drivers/tee/tee_shm.c | 32 +++- 1 file changed,

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

2020-08-24 Thread John Hubbard
g9XLuqaxKRxp2lnuoVdFK0T90Hfu/71T+S8asZZYhH9zHY2Wzhgp1VkR07ZtXmMNqI W/lB00RAVtj3Q== I looked at that, and the equivalent iov_iter_get_pages* and related stuff was just EXPORT_SYMBOL, so I tried to match that. But if it needs to be _GPL then that's fine too... thanks, -- John Hubbard

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

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

2020-08-24 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 --- OK, this should be indentical to v1 [1], but now rebased against Linux 5.9-rc2. As before, I've compile-tested it again with a cross

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

2020-08-24 Thread John Hubbard
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

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: [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-23 Thread John Hubbard
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, to 32 bits. This allows for a nice

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

2020-08-21 Thread John Hubbard
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 files changed, 30 insertions(+), 30 deletions(-) diff --git a/block/bio.c b/block/b

[PATCH 1/5] iov_iter: introduce iov_iter_pin_user_pages*() routines

2020-08-21 Thread John Hubbard
routines that specifically call one or the other systems, for both page acquisition and page release. Signed-off-by: John Hubbard --- include/linux/uio.h | 5 +++ lib/iov_iter.c | 80 + 2 files changed, 85 insertions(+) diff --git a/include

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

2020-08-21 Thread John Hubbard
st, fuse, nfs/direct, vhost/scsi. About-to-be-converted sites (in a subsequent patch) are: Direct IO for filesystems that use the generic read/write functions. [1] https://lore.kernel.org/kvm/20190724061750.ga19...@infradead.org/ [2] "Explicit pinning of user-space pages": https://l

[PATCH 4/5] bio: introduce BIO_FOLL_PIN flag

2020-08-21 Thread John Hubbard
O_FOLL_PIN whenever pin_user_pages_fast() is used, and check for BIO_FOLL_PIN before using unpin_user_page(). Signed-off-by: John Hubbard --- block/bio.c | 9 +++-- block/blk-map.c | 3 ++- fs/direct-io.c| 4 ++-- include/linux/blk_types.h | 5 +++-- inc

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

2020-08-21 Thread John Hubbard
. Signed-off-by: John Hubbard --- fs/ceph/file.c | 3 +-- include/linux/uio.h | 3 ++- lib/iov_iter.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index d51c3f2fdca0..d3d7dd957390 100644 --- a/fs/ceph/file.c +++ b/fs/ceph

[PATCH 2/5] mm/gup: introduce pin_user_page()

2020-08-21 Thread John Hubbard
] "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 --git

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

2020-08-21 Thread John Hubbard
accepted, and the maintainer will eventually merge it", and I left it at that. It's still desirable. thanks, -- John Hubbard NVIDIA

Re: [PATCH] mm/gup_benchmark: update the documentation in Kconfig

2020-08-20 Thread John Hubbard
() The documentation is confusing and needs update. hmmm, it's not that confusing, given that pin_user_pages() and get_user_pages() use the same underlying get_user_pages() implementation. Cc: John Hubbard Cc: Keith Busch Cc: Ira Weiny Cc: Kirill A. Shutemov Signed-off-by: Barry Song --- mm

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

2020-08-19 Thread John Hubbard
ing in the commit log. Some things are better placed in a cover letter or after the "---" line, because they don't need to be recorded forever. Anyway, the diffs seem fine, assuming that you've audited the call sites. thanks, -- John Hubbard NVIDIA Cc: John Hubbard Cc: Jan Kara Cc: Jérô

Re: [PATCH] mm/gup_benchmark: use pin_user_pages for FOLL_LONGTERM flag

2020-08-15 Thread John Hubbard
() with FOLL_LONGTERM, mm/gup_benchmark.c seems to the only exception in which FOLL_PIN is not a prerequisite to FOLL_LONGTERM. Cc: John Hubbard Cc: Jan Kara Cc: Jérôme Glisse Cc: "Matthew Wilcox (Oracle)" Cc: Al Viro Cc: Christoph Hellwig Cc: Dan Williams Cc: Dave Chinner Cc: Jason Gun

Re: btrfs crash in kobject_del while running xfstest

2020-08-11 Thread John Hubbard
Somehow the copy-paste of Chris Mason's name failed (user error on my end), sorry about that Chris! On 8/11/20 4:17 AM, John Hubbard wrote: Hi, Here's an early warning of a possible problem. I'm seeing a new btrfs crash when running xfstests, as of 00e4db51259a5f936fec1424b884f029479d3981

Re: [PATCH v2] mm, dump_page: do not crash with bad compound_mapcount()

2020-08-07 Thread John Hubbard
such assertions. thanks, -- John Hubbard NVIDIA

[PATCH] mm, dump_page: rename head_mapcount() --> head_compound_mapcount()

2020-08-07 Thread John Hubbard
And similarly, rename head_pincount() --> head_compound_pincount(). These names are more accurate (or less misleading) than the original ones. Cc: Qian Cai Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Kirill A. Shutemov Signed-off-by: John Hubbard --- Hi, This is a follow-up patch to

[PATCH v2] mm, dump_page: do not crash with bad compound_mapcount()

2020-08-04 Thread John Hubbard
Signed-off-by: John Hubbard --- Hi, I'm assuming that a fix is not required for -stable, but let me know if others feel differently. The dump_page() code has changed a lot in that area. Changes since v1 [1]: 1) Rebased onto mmotm 2) Used a simpler head_*count() approach. 3) Added Matthew's

Re: [PATCH v2] drivers/virt/fsl_hypervisor: Correcting error handling path

2020-07-29 Thread John Hubbard
d probably good to add a Fixes: tag, too. More: This will address both. Signed-off-by: Souptick Joarder Reviewed-by: Dan Carpenter Cc: John Hubbard --- v2: Added review tag. drivers/virt/fsl_hypervisor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d

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

2020-07-09 Thread John Hubbard
, a migration retry was used for it's sub-pages. Just a documentation nit: "its sub-pages", not "it's sub-pages". thanks, -- John Hubbard NVIDIA

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

2020-07-07 Thread John Hubbard
Cc: Zi Yan Cc: John Hubbard Cc: Naoya Horiguchi Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Zi Yan Signed-off-by: Anshuman Khandual This is missing the Documentation/ Cc's, did you run scripts/get_maintainer.pl? I'm adding linux-doc

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

2020-07-07 Thread John Hubbard
le to have? No, they are not. And there are a couple more pre-existing cases as well, right above what can be seen here (this patch just follows the local pattern) that should also be removed. thanks, -- John Hubbard NVIDIA

Re: [PATCH v2 2/3] xen/privcmd: Mark pages as dirty

2020-07-07 Thread John Hubbard
even though the call site conversions are nearly done. thanks, -- John Hubbard NVIDIA

Re: [PATCH v4 26/26] mm/gup: Remove task_struct pointer for all gup code

2020-07-01 Thread John Hubbard
| 2 +- 18 files changed, 65 insertions(+), 82 deletions(-) Looks good: Reviewed-by: John Hubbard One minor refinement: in gup.c, if you add the following hunk on top of your changes, that will eradicate the last reference to struct task, in that file: diff --git a/mm/gup.c b/mm/gup.c

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

2020-06-29 Thread John Hubbard
uld be more willing to pick them up. Any testing help there is greatly appreciated! thanks, -- John Hubbard NVIDIA

Re: [PATCH 01/26] mm: Do page fault accounting in handle_mm_fault

2020-06-28 Thread John Hubbard
e a number of changes to mm/gup.c (not a concern for this patch, but it is for the overall series). So I'm hoping you're going to post a version that is rebased against 5.8-rc*. thanks, -- John Hubbard NVIDIA

Re: [PATCH] nouveau: fix page fault on device private memory

2020-06-26 Thread John Hubbard
-5.8.0-rc2 and is for Ben Skeggs nouveau tree. It doesn't depend on any of the other nouveau/HMM changes I have recently posted. Maybe cc stable, seeing as how the problem affect Linux 5.7? thanks, -- John Hubbard NVIDIA drivers/gpu/drm/nouveau/nouveau_svm.c | 1 + 1 file changed, 1 insertion(+)

Re: [PATCH 2/2] xen/privcmd: Convert get_user_pages*() to pin_user_pages*()

2020-06-26 Thread John Hubbard
On 2020-06-25 22:26, Souptick Joarder wrote: On Thu, Jun 25, 2020 at 11:19 AM John Hubbard wrote: On 2020-06-24 20:02, Souptick Joarder wrote: ... @@ -612,13 +612,7 @@ static int lock_pages( static void unlock_pages(struct page *pages[], unsigned int nr_pages) { - unsigned int i

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

2020-06-25 Thread John Hubbard
Cornelia Huck Cc: k...@vger.kernel.org Signed-off-by: John Hubbard --- Hi, Changes since v1: rebased onto Linux-5.8-rc2. thanks, John Hubbard drivers/vfio/vfio_iommu_spapr_tce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vf

Re: [PATCH 2/2] xen/privcmd: Convert get_user_pages*() to pin_user_pages*()

2020-06-24 Thread John Hubbard
.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: Souptick Joarder Cc: John Hubbard Cc: Boris Ostrovsky Cc: Paul Durrant --- Hi, I'm compile tested this, but unable to run-time test, so any testing help is much appriciated.

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread John Hubbard
t/lists/linux-mm/msg142700.html thanks, -- John Hubbard NVIDIA

Re: [PATCH] mm: Skip opportunistic reclaim for dma pinned pages

2020-06-24 Thread John Hubbard
ugh. And I *think* it's actually safe to do this, as it stays away from writeback or other filesystem activity. But let me double check that, in case I'm forgetting something. thanks, -- John Hubbard NVIDIA

Re: [RESEND PATCH 3/3] nouveau: make nvkm_vmm_ctor() and nvkm_mmu_ptp_get() static

2020-06-22 Thread John Hubbard
*, u64 addr, u64 size); Looks accurate: the order within vmm.c (now that there is no .h declaration) is still good, and I found no other uses of either function within the linux.git tree, so Reviewed-by: John Hubbard

Re: [RESEND PATCH 1/3] nouveau: fix migrate page regression

2020-06-22 Thread John Hubbard
r for maintenance, too, because the function never intends to migrate "some number of bytes". It intends to migrate exactly one page. Hope I'm not missing something fundamental, but: Reviewed-by: John Hubbard

Re: [RESEND PATCH 2/3] nouveau: fix mixed normal and device private page migration

2020-06-22 Thread John Hubbard
cription, right? (It feels like a casualty of rearranging the patches.) thanks, -- John Hubbard NVIDIA

Re: [PATCH 13/16] mm: support THP migration to device private memory

2020-06-22 Thread John Hubbard
ck to base page OK, but *all* page entries (base and huge/large pages) need to be cleared, when migrating to device memory, unless I'm really confused here. So: not CoW. thanks, -- John Hubbard NVIDIA

Re: [RFC PATCH] xen/privcmd: Convert get_user_pages*() to pin_user_pages*()

2020-06-19 Thread John Hubbard
er. unpin_user_pages() is the right place to do so. John any thought ? So far I haven't seen any cases to justify changing the implementation of unpin_user_pages(). thanks, -- John Hubbard NVIDIA

Re: [PATCH] docs: mm/gup: Minor documentation update

2020-06-19 Thread John Hubbard
On 2020-06-17 12:27, Souptick Joarder wrote: Now there are 5 cases. Updated the same. Signed-off-by: Souptick Joarder Cc: John Hubbard --- Documentation/core-api/pin_user_pages.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/core-api/pin_user_pages.rst

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

2020-06-12 Thread John Hubbard
On 2020-06-12 12:24, Matthew Wilcox wrote: On Fri, May 29, 2020 at 04:43:08PM -0700, John Hubbard wrote: +CASE 5: Pinning in order to write to the data within the page +- +Even though neither DMA nor Direct IO is involved, just

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

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 refe

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

[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

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