[PATCH v2 0/3] mm/gup: introduce vaddr_pin_pages_remote(), FOLL_PIN

2019-08-20 Thread John Hubbard
that there are a lot of references in comments and commit logs, to vaddr_pin_pages(). We'll want to catch all of those if we rename that. I am pushing pretty hard to rename it to vaddr_pin_user_pages(). v1 of this may be found here: https://lore.kernel.org/r/20190812015044.26176-1-jhubb...@nvidia.com John

[PATCH v2 1/3] For Ira: tiny formatting tweak to kerneldoc

2019-08-20 Thread John Hubbard
For your vaddr_pin_pages() and vaddr_unpin_pages(). Just merge it into wherever it goes please. Didn't want to cause merge problems so it's a separate patch-let. Signed-off-by: John Hubbard --- mm/gup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c

disregard: [PATCH 1/4] checkpatch: revert broken NOTIFIER_HEAD check

2019-08-20 Thread John Hubbard
On 8/20/19 9:03 PM, John Hubbard wrote: commit 1a47005dd5aa ("checkpatch: add *_NOTIFIER_HEAD as var definition") causes the following warning when run on some patches: Please disregard this series. It's stale. thanks, -- John Hubbard NVIDIA

[PATCH v2 3/3] mm/gup: introduce vaddr_pin_pages_remote(), and invoke it

2019-08-20 Thread John Hubbard
Signed-off-by: John Hubbard Cc: Ira Weiny --- include/linux/mm.h | 5 + mm/gup.c | 34 ++ mm/process_vm_access.c | 23 +-- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/include/linux/mm.h b/include/linux/

[PATCH v2 2/3] mm/gup: introduce FOLL_PIN flag for get_user_pages()

2019-08-20 Thread John Hubbard
Vlastimil Babka Cc: Jan Kara Cc: Michal Hocko Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 1 + include/linux/mm.h | 56 ++ mm/gup.c | 2 +- 3 files changed, 52 insertions(+), 7 deletions(-)

Re: [PATCH 0/3] mm/: 3 more put_user_page() conversions

2019-08-06 Thread John Hubbard
es" is in > the works, so can we make that a 37 patch series? > Sure, I'll add them to that. thanks, -- John Hubbard NVIDIA

[PATCH v3 26/41] futex: convert put_page() to put_user_page*()

2019-08-06 Thread john . hubbard
From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeh

[PATCH v3 18/41] drivers/tee: convert put_page() to put_user_page*()

2019-08-06 Thread john . hubbard
From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeh

[PATCH v3 14/41] vmci: convert put_page() to put_user_page*()

2019-08-06 Thread john . hubbard
From: John Hubbard For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeh

Re: [PATCH 00/12] block/bio, fs: convert put_page() to put_user_page*()

2019-08-07 Thread John Hubbard
On 8/6/19 11:34 PM, Christoph Hellwig wrote: On Mon, Aug 05, 2019 at 03:54:35PM -0700, John Hubbard wrote: On 7/23/19 11:17 PM, Christoph Hellwig wrote: ... I think we can do this in a simple and better way. We have 5 ITER_* types. Of those ITER_DISCARD as the name suggests never uses pages

Re: Warnings whilst building 5.2.0+

2019-08-07 Thread John Hubbard
hoping... :) [1] https://lore.kernel.org/r/20190731054627.5627-2-jhubb...@nvidia.com ("x86/boot: save fields explicitly, zero out everything else") thanks, -- John Hubbard NVIDIA

Re: [PATCH v2] x86/boot: save fields explicitly, zero out everything else

2019-08-07 Thread John Hubbard
for so(). > Hi David, There was discussion about that [1], but preference ending up being to flip this around, in order to more closely match the original intent of this function (zero out everything except for certain carefully selected fields), and to therefore be more likely to keep working if fields are added. [1] https://lore.kernel.org/lkml/alpine.deb.2.21.1907252358240.1...@nanos.tec.linutronix.de/ thanks, -- John Hubbard NVIDIA

Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*()

2019-08-07 Thread John Hubbard
On 8/7/19 4:01 AM, Michal Hocko wrote: > On Mon 05-08-19 15:20:17, john.hubb...@gmail.com wrote: >> From: John Hubbard >> >> For pages that were retained via get_user_pages*(), release those pages >> via the new put_user_page*() routines, instead of via put_page() or &

Re: [PATCH] powerpc: convert put_page() to put_user_page*()

2019-08-07 Thread John Hubbard
help improve the system] > > url: > https://github.com/0day-ci/linux/commits/john-hubbard-gmail-com/powerpc-convert-put_page-to-put_user_page/20190805-132131 > config: powerpc-allmodconfig (attached as .config) > compiler: powerpc64-linux-gcc (GCC) 7.4.0 > reproduce: >

Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*()

2019-08-08 Thread John Hubbard
On 8/8/19 4:09 AM, Vlastimil Babka wrote: > On 8/8/19 8:21 AM, Michal Hocko wrote: >> On Wed 07-08-19 16:32:08, John Hubbard wrote: >>> On 8/7/19 4:01 AM, Michal Hocko wrote: >>>> On Mon 05-08-19 15:20:17, john.hubb...@gmail.com wrote: >>>>&

Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*()

2019-08-08 Thread John Hubbard
On 8/8/19 12:20 PM, John Hubbard wrote: > On 8/8/19 4:09 AM, Vlastimil Babka wrote: >> On 8/8/19 8:21 AM, Michal Hocko wrote: >>> On Wed 07-08-19 16:32:08, John Hubbard wrote: >>>> On 8/7/19 4:01 AM, Michal Hocko wrote: >>>>> On Mon 05-08-19 15:20:

Re: [Linux-kernel-mentees][PATCH v4 1/1] sgi-gru: Remove *pte_lookup functions

2019-08-08 Thread John Hubbard
<< ps) - 1); > + paddr = paddr & ~((1UL << *pageshift) - 1); > *gpa = uv_soc_phys_ram_to_gpa(paddr); > - *pageshift = ps; Why are you no longer setting *pageshift? There are a couple of callers that both use this variable. thanks, -- John Hubbard NVIDIA

Re: [Linux-kernel-mentees][PATCH v4 1/1] sgi-gru: Remove *pte_lookup functions

2019-08-08 Thread John Hubbard
On 8/8/19 4:21 PM, John Hubbard wrote: > On 8/8/19 11:55 AM, Bharath Vedartham wrote: > ... >> if (is_gru_paddr(paddr)) >> goto inval; >> -paddr = paddr & ~((1UL << ps) - 1); >> +paddr = paddr & ~((1UL << *pageshift)

Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*()

2019-08-08 Thread John Hubbard
On 8/8/19 4:41 PM, Ira Weiny wrote: > On Thu, Aug 08, 2019 at 03:59:15PM -0700, John Hubbard wrote: >> On 8/8/19 12:20 PM, John Hubbard wrote: >>> On 8/8/19 4:09 AM, Vlastimil Babka wrote: >>>> On 8/8/19 8:21 AM, Michal Hocko wrote: >>>>> On Wed 07-08-1

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-15 Thread John Hubbard
On 8/15/19 10:32 AM, Ira Weiny wrote: > On Thu, Aug 15, 2019 at 03:35:10PM +0200, Jan Kara wrote: >> On Thu 15-08-19 15:26:22, Jan Kara wrote: >>> On Wed 14-08-19 20:01:07, John Hubbard wrote: >>>> On 8/14/19 5:02 PM, John Hubbard wrote: >>>>

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-15 Thread John Hubbard
On 8/15/19 10:41 AM, John Hubbard wrote: > On 8/15/19 10:32 AM, Ira Weiny wrote: >> On Thu, Aug 15, 2019 at 03:35:10PM +0200, Jan Kara wrote: >>> On Thu 15-08-19 15:26:22, Jan Kara wrote: >>>> On Wed 14-08-19 20:01:07, John Hubbard wrote: >>>>> On 8

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread John Hubbard
On 8/16/19 11:33 AM, Ira Weiny wrote: On Fri, Aug 16, 2019 at 05:41:08PM +0200, Jan Kara wrote: On Thu 15-08-19 19:14:08, John Hubbard wrote: On 8/15/19 10:41 AM, John Hubbard wrote: On 8/15/19 10:32 AM, Ira Weiny wrote: On Thu, Aug 15, 2019 at 03:35:10PM +0200, Jan Kara wrote: On Thu 15-08

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread John Hubbard
On 8/16/19 2:59 PM, Ira Weiny wrote: > On Fri, Aug 16, 2019 at 11:50:09AM -0700, John Hubbard wrote: ... >>> John could you send a formal patch using vaddr_pin* and I'll add it to the >>> tree? >>> >> >> Yes...hints about which struct file to use here are

Re: [RFC PATCH v2 2/3] mm/gup: introduce FOLL_PIN flag for get_user_pages()

2019-08-16 Thread John Hubbard
On 8/16/19 7:24 PM, jhubb...@nvidia.com wrote: > From: John Hubbard > DKIM-Signature: v a a-sha256; claxed/relaxed; d idia.com; s; > t66008674; bhMai0va6k/z2enpQJ4Nfvbj5WByFxGAO1JwdIBbXioh > PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: >

Re: [PATCH 3/3] sgi-gru: Use __get_user_pages_fast in atomic_pte_lookup

2019-07-22 Thread John Hubbard
On 7/22/19 10:53 AM, Bharath Vedartham wrote: > On Sun, Jul 21, 2019 at 07:32:36PM -0700, John Hubbard wrote: >> On 7/21/19 8:58 AM, Bharath Vedartham wrote: ... >> Also, optional: as long as you're there, atomic_pte_lookup() ought to >> either return a bool (true == success

[PATCH 01/12] mm/gup: add make_dirty arg to put_user_pages_dirty_lock()

2019-07-23 Thread john . hubbard
From: John Hubbard Provide more capable variation of put_user_pages_dirty_lock(), and delete put_user_pages_dirty(). This is based on the following: 1. Lots of call sites become simpler if a bool is passed into put_user_page*(), instead of making the call site choose which put_user_page

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

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

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

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

[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

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

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

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

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

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 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-30 Thread John Hubbard
are definitely welcome here. thanks, -- John Hubbard NVIDIA

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

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

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

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: [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-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: [PATCH 5/5] mm/thp: Split huge pmds/puds if they're pinned when fork()

2020-09-23 Thread John Hubbard
non_" adds more meaning.) ...now I better go and try to grok what Jason is recommending for the new meaning of FOLL_PIN, in another tributary of this thread. I don't *think* it affects this naming point, though. :) thanks, -- John Hubbard NVIDIA

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
On 10/27/20 6:15 AM, Jason Gunthorpe wrote: On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: On Fri 23-10-20 21:44:17, John Hubbard wrote: On 10/23/20 5:19 PM, Jason Gunthorpe wrote: + start += (unsigned long)nr_pinned << PAGE_SHIFT; + pages += nr_pinned; +

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
On 10/27/20 11:00 PM, John Hubbard wrote: On 10/27/20 6:15 AM, Jason Gunthorpe wrote: On Tue, Oct 27, 2020 at 10:33:01AM +0100, Jan Kara wrote: On Fri 23-10-20 21:44:17, John Hubbard wrote: On 10/23/20 5:19 PM, Jason Gunthorpe wrote: ... I'll fix up that one above (using your Reported

Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()

2020-10-28 Thread John Hubbard
it can go further, at some point, but that's a good way to start. I'm leaning toward just sending out a small series to do that, unless there are objections and/or better ways to improve this area... thanks, -- John Hubbard NVIDIA

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

2020-11-04 Thread John Hubbard
nly implementation that can pin pages. Thus it's still * useful to have gup_huge_pmd even if we can't operate on ptes. */ thanks, -- John Hubbard NVIDIA

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 3/5] mm: Rework return value for copy_one_pte()

2020-09-22 Thread John Hubbard
break; + default: + break; I assume this no-op noise is to placate the compiler and/or static checkers. :) I'm unable to find any actual problems with the diffs, aside from the nit about using an enum. thanks, -- John Hubbard NVIDIA

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

2020-09-22 Thread John Hubbard
On 9/22/20 8:17 AM, Peter Xu wrote: On Mon, Sep 21, 2020 at 04:53:38PM -0700, 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

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

2020-09-22 Thread John Hubbard
On 9/22/20 8:17 AM, Peter Xu wrote: On Mon, Sep 21, 2020 at 04:53:38PM -0700, John Hubbard wrote: On 9/21/20 2:17 PM, Peter Xu wrote: ... diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 496c3ff97cce..6f291f8b74c6 100644 --- a/include/linux/mm_types.h +++ b/include/linux

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

2020-09-22 Thread John Hubbard
On 9/22/20 3:33 AM, Jan Kara wrote: On Mon 21-09-20 23:41:16, John Hubbard wrote: On 9/21/20 2:20 PM, Peter Xu wrote: ... + if (unlikely(READ_ONCE(src_mm->has_pinned) && +page_maybe_dma_pinned(src_page))) { This condition would make a good static inli

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

2020-09-28 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. Signed-

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

2020-09-28 Thread John Hubbard
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-by: John Hubbard

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

2020-09-28 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-28 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/testing

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

2020-09-28 Thread John Hubbard
-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/testing/selftests/vm/check_config.sh

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

2020-09-28 Thread John Hubbard
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/vm:

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

2020-09-28 Thread John Hubbard
, but 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-28 Thread John Hubbard
, 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/Makefile b

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

2020-09-28 Thread John Hubbard
ges -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 Hubbard ---

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), w

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 po

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

2020-09-28 Thread John Hubbard
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: [resource] 22b17dc667: Kernel panic - not syncing: Fatal exception

2020-11-02 Thread John Hubbard
/O RESET_REG. To reproduce: git clone https://github.com/intel/lkp-tests.git cd lkp-tests bin/lkp install job.yaml # job file is attached in this email bin/lkp run job.yaml Thanks, oliver.s...@intel.com thanks, -- John Hubbard NVIDIA

Re: [RFC PATCH resend 3/6] mm: Add refcount for preserving mm_struct without pgd

2020-11-03 Thread John Hubbard
? :) Make alot more sense to me.. I think this patch needs to do something about the naming.. A third counter also seems like the tipping point, to me. thanks, -- John Hubbard NVIDIA

Re: [PATCH v2 2/2] mm: prevent gup_fast from racing with COW during fork

2020-11-03 Thread John Hubbard
_do_ prefix instead. Note, a plain "__" prefix is not used since seqlock.h already uses it for some of its exported functions; e.g. __read_seqcount_begin() and __read_seqcount_retry(). Reported-by: Jason Gunthorpe Reported-by: John Hubbard Reported-by: Linus Torvalds Link: h

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

2020-10-31 Thread John Hubbard
On 10/31/20 7:45 AM, Daniel Vetter wrote: On Sat, Oct 31, 2020 at 3:55 AM John Hubbard wrote: On 10/30/20 3:08 AM, Daniel Vetter wrote: ... By removing this check from this location, and changing from pin_user_pages_locked() to pin_user_pages_fast(), I *think* we end up losing the check

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

2020-11-01 Thread John Hubbard
On 11/1/20 2:30 AM, Daniel Vetter wrote: On Sun, Nov 1, 2020 at 6:22 AM John Hubbard wrote: On 10/31/20 7:45 AM, Daniel Vetter wrote: On Sat, Oct 31, 2020 at 3:55 AM John Hubbard wrote: On 10/30/20 3:08 AM, Daniel Vetter wrote: ... By removing this check from this location, and changing

Re: [PATCH v2 2/2] mm: prevent gup_fast from racing with COW during fork

2020-11-02 Thread John Hubbard
for general use", also identifying those as such. c) A comment about what makes "raw" actually raw, for seqlock. Since I'm proposing new work, I'll also offer to help, perhaps by putting together a small patch to get it kicked off, if you approve of the idea. thanks, -- John Hubbard NVIDIA

Re: The ext3 way of journalling

2008-01-14 Thread John Hubbard
rly shutdown. Hope that adds some clarity. thanks, John Hubbard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: Bitops source problem

2008-01-16 Thread John Hubbard
the lock prefix. The function above does not use the lock prefix, so it is not atomic. thanks, John Hubbard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordom

Re: [PATCH 1/4] mm/gup: add compound page list iterator

2021-02-03 Thread John Hubbard
npages; i += ntails, \ +compound_next(i, npages, list, , )) + /** * unpin_user_pages_dirty_lock() - release and optionally dirty gup-pinned pages * @pages: array of pages to be maybe marked dirty, and definitely released. thanks, -- John Hubbard NVIDIA

Re: [PATCH 4/4] RDMA/umem: batch page unpin in __ib_mem_release()

2021-02-03 Thread John Hubbard
y, the for_each_sg() code and its behavior with sg->length and sg_page(sg) confuses me because I'm new to it, and I don't quite understand how this works. Especially with SG_CHAIN. I'm assuming that you've monitored /proc/vmstat for nr_foll_pin* ? sg_free_table(>sg_head); } thanks, -- John Hubbard NVIDIA

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-03 Thread John Hubbard
return 1; return min_t(unsigned int, (head + compound_nr(head) - page), npages); thanks, -- John Hubbard NVIDIA + for (ntails = 1; ntails < npages; ntails++) { if (compound_head(pages[ntails]) != head) break; @@ -229,20 +234,32 @@ stat

Re: [PATCH 3/4] mm/gup: add a range variant of unpin_user_pages_dirty_lock()

2021-02-03 Thread John Hubbard
hould rename it to something like: unpin_user_compound_page_dirty_lock() ? thanks, -- John Hubbard NVIDIA

Re: [PATCH 2/4] mm/gup: decrement head page once for group of subpages

2021-02-03 Thread John Hubbard
elated one below) finally done! Everything looks correct here. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA + struct page *head; + unsigned int ntails; if (!make_dirty) { unpin_user_pages(pages, npages); return; } - for

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
cma, const struct page *pages, unsigned int count); extern int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data); + A single additional blank line seems to be the only change to this file. :) thanks, -- John Hubbard NVIDIA

Re: [PATCH v2 net-next 3/4] net: introduce common dev_page_is_reserved()

2021-01-30 Thread John Hubbard
ot; seems better to me, and especially anything *other* than "reserved" is a good idea, IMHO. thanks, -- John Hubbard NVIDIA

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

2019-07-15 Thread John Hubbard
Cc: Matt Sickler > Cc: Greg Kroah-Hartman > Cc: Jérôme Glisse > Cc: Ira Weiny > Cc: John Hubbard > Cc: linux...@kvack.org > Cc: de...@driverdev.osuosl.org > > Signed-off-by: Bharath Vedartham > --- > drivers/staging/kpc2000/kpc_dma/fileops.c | 8 ++-- >

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

2019-07-15 Thread john . hubbard
From: John Hubbard This commit was created by running indent(1): `indent -linux` ...and then applying some manual corrections and cleanup afterward, to keep it sane. No functional changes were made. In addition to whitespace changes, some strings were split, but not strings that were

[PATCH 0/1] staging: kpc2000: whitespace and line length cleanup

2019-07-15 Thread john . hubbard
From: John Hubbard Hi everyone, This is an easy, drive-by cleanup that I did while reviewing Bharath's changes to convert over to put_user_page(). It should make the code less obviously non-conforming, and therefore help future reviews and cleanups. This is on top of latest linux.git, commit

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