Re: [PATCH v3 17/25] gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2024-11-21 Thread John Hubbard
!folio_is_zone_movable(folio); Reviewed-by: John Hubbard thanks, -- John Hubbard

Re: [PATCH v3 05/25] fs/dax: Create a common implementation to break DAX layouts

2024-11-21 Thread John Hubbard
(cb)(struct inode *)) @@ -979,6 +981,7 @@ void dax_break_mapping_uninterruptible(struct inode *inode, if (!page) dax_delete_mapping_range(inode->i_mapping, 0, LLONG_MAX); } +EXPORT_SYMBOL_GPL(dax_break_mapping_uninterruptible); /* * Invalidate DAX entry if it is c

Re: [PATCH 1/1] arch/fault: don't print logs for simulated poison errors

2024-05-09 Thread John Hubbard
| 2 +- 6 files changed, 21 insertions(+), 8 deletions(-) This completely fixes the uffd-unit-test behavior, I just did a quick test run to be sure as well. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c ind

Re: [PATCH 0/1] arch/fault: don't print logs for simulated poison errors

2024-05-09 Thread John Hubbard
| 3 ++- mm/memory.c | 2 +- 6 files changed, 21 insertions(+), 8 deletions(-) -- 2.45.0.118.g7fe29c98d7-goog thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 3/3] mm: use "GUP-fast" instead "fast GUP" in remaining comments

2024-04-13 Thread John Hubbard
+- mm/khugepaged.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Yes, everything is changed over now, confirmed. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 2/3] mm/treewide: rename CONFIG_HAVE_FAST_GUP to CONFIG_HAVE_GUP_FAST

2024-04-13 Thread John Hubbard
ch/sh/Kconfig| 2 +- arch/x86/Kconfig | 2 +- include/linux/rmap.h | 8 kernel/events/core.c | 4 ++-- mm/Kconfig | 2 +- mm/gup.c | 10 +- mm/internal.h | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-)

Re: [PATCH v1 1/3] mm/gup: consistently name GUP-fast functions

2024-04-13 Thread John Hubbard
roperly named With "gup_fast()", we now even have a function that is referred to in comment in mm/mmu_gather.c. Reviewed-by: Jason Gunthorpe Reviewed-by: Mike Rapoport (IBM) Signed-off-by: David Hildenbrand --- mm/gup.c | 205 --- 1 file changed, 103 insertions(+), 102 deletions(-) Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA

Re: [PATCH v6 12/18] arm64/mm: Wire up PTE_CONT for user mappings

2024-02-16 Thread John Hubbard
On 2/16/24 08:56, Catalin Marinas wrote: ... The problem is that the contpte_* symbols are called from the ptep_* inline functions. So where those inlines are called from modules, we need to make sure the contpte_* symbols are available. John Hubbard originally reported this problem against v1

Re: [PATCH v3 3/7] mm/hotplug: Allow architecture to override memmap on memory support check

2023-07-14 Thread John Hubbard
picture of the preferred ways to do arch overrides. Thanks for taking the time to look into it, and also to explain it. Much appreciated! thanks, -- John Hubbard NVIDIA

Re: [PATCH v3 3/7] mm/hotplug: Allow architecture to override memmap on memory support check

2023-07-12 Thread John Hubbard
ak can have unintended link defects. Avoid using them. ...which seems deeply out of touch with how arch layers work these days, doesn't it? (This is not rhetorical; I'm asking in order to get an opinion or two on the topic.) thanks, -- John Hubbard NVIDIA

Re: [PATCH mm-unstable v1 09/20] mm/gup: reliable R/O long-term pinning in COW mappings

2022-11-23 Thread John Hubbard
include/linux/mm.h | 27 --- mm/gup.c | 10 +- mm/huge_memory.c | 2 +- mm/hugetlb.c | 7 --- 4 files changed, 34 insertions(+), 12 deletions(-) Looks good, Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA diff -

Re: [PATCH 6/7] nouveau/dmem: Evict device private memory during release

2022-09-26 Thread John Hubbard
some point, we're going to make this all work with file-backed memory, which will *definitely* not be discardable--I realize that we're not there yet, of course. But here, it's reasonable to commit to just retrying indefinitely, really. Memory should eventually show up. And if it doesn't, then restarting the machine is better than corrupting data, generally. thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 1/3] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")

2022-09-22 Thread John Hubbard
On 9/22/22 19:26, John Hubbard wrote: > > Reviewed-by: John Hubbard > I forgot to mention that I had applied your fix to Akira's issue, before reviewing. So that fix works and builds and looks nice too. thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 1/3] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel")

2022-09-22 Thread John Hubbard
to crash. > + > +Use BUILD_BUG_ON() for compile-time assertions > +** > + > +The use of BUILD_BUG_ON() is acceptable and encouraged, because it is a > +compile-time assertion that has no effect at runtime. > + > Appendix I) References > -- > I like the wording, it feels familiar somehow! :) Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 3/3] checkpatch: warn on usage of VM_BUG_ON() and other BUG variants

2022-09-22 Thread John Hubbard
the original suggestion but it's not a big deal either way. Yes, stronger wording is better. So how about this: "Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants\n" . $herecurr); thanks, -- John Hubbard NVIDIA

Re: [PATCH v1 3/3] checkpatch: warn on usage of VM_BUG_ON() and other BUG variants

2022-09-22 Thread John Hubbard
not crash the kernel unless it is > unavoidable - use WARN_ON_ONCE & recovery code (if reasonable) rather than > BUG() or variants.\n" . $herecurr); Here's a requested tweak, to clean up the output and fix punctuation: "Avoid crashing the kernel--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants.\n" . $herecurr); thanks, -- John Hubbard NVIDIA

Re: [v2 PATCH 1/2] mm: gup: fix the fast GUP race against THP collapse

2022-09-07 Thread John Hubbard
ent. * Moved the comment right before gup_pte_range() instead of in the body of the function, per John. * Added patch 2/2 per Aneesh. mm/gup.c| 34 -- mm/khugepaged.c | 10 ++ 2 files changed, 34 insertions(+), 10 deletions(-) Loo

Re: [PATCH v4 4/4] selftests/hmm-tests: Add test for dirty bits

2022-09-07 Thread John Hubbard
er fix the test or drop it if we think it's no longer possible to hit. Oh no no no, please. This is not how to do tests. If you want a TODO list somewhere, there are other ways. But tests that require maintenance when you change something are an anti-pattern. thanks, -- John Hubbard NVIDIA

Re: [PATCH v4 4/4] selftests/hmm-tests: Add test for dirty bits

2022-09-04 Thread John Hubbard
_sys_to_dev(self->fd, buffer, npages)); Are you really sure that you want to assert on that? Because doing so guarantees a test failure if and when we every upgrade the kernel to be able to migrate swap-backed pages. And I seem to recall that this current inability to migrate swap-backed pages is considered a flaw to be fixed, right? > + > + ASSERT_FALSE(write_cgroup_param(cgroup, "memory.reclaim", 1UL<<30)); > + > + /* Check we still see the updated data after restoring from swap. */ > + for (i = 0, ptr = buffer->ptr; i < size / sizeof(*ptr); ++i) > + ASSERT_EQ(ptr[i], i); > + > + hmm_buffer_free(buffer); > + destroy_cgroup(); > +} > + > /* > * Read anonymous memory multiple times. > */ thanks, -- John Hubbard NVIDIA

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

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

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

2020-09-15 Thread John Hubbard
X1 Cc: # 5.2+ Fixes: 1a42010cdc26 ("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 H

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. Remember t

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

2020-09-10 Thread John Hubbard
at their contents are 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: [linux-next RFC v2] mm/gup.c: Convert to use get_user_{page|pages}_fast_only()

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

Re: [linux-next RFC] mm/gup.c: Convert to use get_user_pages_fast_only()

2020-05-23 Thread John Hubbard
building up, but that's merely an indication of the wide usage of this functionality. So it all feels about right. thanks, -- John Hubbard NVIDIA

Re: [PATCH v6 02/11] mm/gup: Use functions to track lockless pgtbl walks on gup_pgd_range

2020-02-07 Thread John Hubbard
t;> ret = nr; >> } >> > > Just noticed IRQS_ENABLED is not available on other archs than ppc64. > I will fix this for v7. > What's the fix going to look like, approximately? thanks, -- John Hubbard NVIDIA

Re: [PATCH v12 04/22] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2020-01-16 Thread John Hubbard
On 1/16/20 1:37 AM, Christoph Hellwig wrote: On Wed, Jan 15, 2020 at 01:19:41PM -0800, John Hubbard wrote: On 1/15/20 7:23 AM, Christoph Hellwig wrote: ... I'm really not sold on this scheme. Note that I think it is particularly bad, but it also doesn't seem any better than w

Re: [PATCH v12 11/22] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2020-01-15 Thread John Hubbard
On 1/15/20 7:30 AM, Christoph Hellwig wrote: > On Tue, Jan 07, 2020 at 02:45:47PM -0800, John Hubbard wrote: >> Introduce pin_user_pages*() variations of get_user_pages*() calls, >> and also pin_longterm_pages*() variations. >> >> For now, these are placeholder calls, u

Re: [PATCH v12 04/22] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2020-01-15 Thread John Hubbard
ge, GUP_PIN_COUNTING_BIAS)) + __put_page(page); + + __update_proc_vmstat(page, NR_FOLL_PIN_RETURNED, 1); +} +EXPORT_SYMBOL(unpin_user_page); [1] https://lore.kernel.org/r/20191216222537.491123-24-jhubb...@nvidia.com [PATCH v11 23/25] mm/gup: track FOLL_PIN pages thanks, -- John Hubbard NVIDIA

Re: [PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-14 Thread John Hubbard
On 1/9/20 2:07 PM, John Hubbard wrote: > On 1/7/20 2:45 PM, John Hubbard wrote: >> Hi, >> >> The "track FOLL_PIN pages" would have been the very next patch, but it is >> not included here because I'm still debugging a bug report from Leon. >> L

Re: [PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-09 Thread John Hubbard
On 1/7/20 2:45 PM, John Hubbard wrote: > Hi, > > The "track FOLL_PIN pages" would have been the very next patch, but it is > not included here because I'm still debugging a bug report from Leon. > Let's get all of the prerequisite work (it's been reviewed

[PATCH v12 16/22] fs/io_uring: set FOLL_PIN via pin_user_pages()

2020-01-07 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 562e3a1a1bf9..9f804cb25c61 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4815,7 +4815,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v12 14/22] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2020-01-07 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH v12 09/22] IB/umem: use get_user_pages_fast() to pin DMA pages

2020-01-07 Thread John Hubbard
Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 7a3b99597ead..214e87aa609d 100644 --- a/drivers

[PATCH v12 11/22] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2020-01-07 Thread John Hubbard
timil Babka for explaining the 4 cases in this documentation. (I've reworded it and expanded upon it.) Reviewed-by: Jan Kara Reviewed-by: Mike Rapoport # Documentation Reviewed-by: Jérôme Glisse Cc: Jonathan Corbet Cc: Ira Weiny Signed-off-by: John Hubbard --- Documentatio

[PATCH v12 22/22] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2020-01-07 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH v12 08/22] mm/gup: allow FOLL_FORCE for get_user_pages_fast()

2020-01-07 Thread John Hubbard
_FORCE to be set for get_user_pages_fast(). Fixes: 817be129e6f2 ("mm: validate get_user_pages_fast flags") Cc: Christoph Hellwig Reviewed-by: Leon Romanovsky Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[PATCH v12 06/22] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2020-01-07 Thread John Hubbard
Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- mm/gup.c | 174 +-- 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 5938e29a5a8b..b61bd5c469ae 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -

[PATCH v12 13/22] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2020-01-07 Thread John Hubbard
ned-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_odp.c | 13 ++--- drivers/infiniband/hw/hfi1/user_pages.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/qib/qib_user_pag

[PATCH v12 17/22] net/xdp: set FOLL_PIN via pin_user_pages()

2020-01-07 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v12 18/22] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2020-01-07 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2

[PATCH v12 07/22] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2020-01-07 Thread John Hubbard
's no need for it at the VFIO call site. So remove it. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfi

[PATCH v12 04/22] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2020-01-07 Thread John Hubbard
Kara Signed-off-by: Ira Weiny Signed-off-by: John Hubbard --- include/linux/mm.h | 18 +- mm/memremap.c | 15 +-- mm/swap.c | 27 ++- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/include/linux/mm.h b/incl

[PATCH v12 01/22] mm/gup: factor out duplicate code from four routines

2020-01-07 Thread John Hubbard
e the successful end of each routine, to increment *nr. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Reviewed-by: Jan Kara Cc: Kirill A. Shutemov Cc: Ira Weiny Cc: Christoph Hellwig Cc: Aneesh Kumar K.V Signed-off-by: John Hubbard --- mm/gup.c

[PATCH v12 03/22] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2020-01-07 Thread John Hubbard
p is only needed in the MEMORY_DEVICE_FSDAX case, but it does no harm in the MEMORY_DEVICE_DEVDAX and MEMORY_DEVICE_PCI_P2PDMA case. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Cc: Jan Kara Cc: Ira Weiny Signed-off-by: Dan Williams Signed-off-by: John Hubbard --- drivers/nvdimm/pm

[PATCH v12 12/22] goldish_pipe: convert to pin_user_pages() and put_user_page()

2020-01-07 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

[PATCH v12 10/22] media/v4l2-core: set pages dirty upon releasing DMA buffers

2020-01-07 Thread John Hubbard
lling set_page_dirty_lock() if the CPU pages were potentially receiving data from the device. Reviewed-by: Christoph Hellwig Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: Signed-off-by: John Hubbard --- drivers/media/v4l2-core/videobuf-dma-sg.c | 5 - 1 file changed, 4 insertions(+), 1 del

[PATCH v12 02/22] mm/gup: move try_get_compound_head() to top, fix minor issues

2020-01-07 Thread John Hubbard
An upcoming patch uses try_get_compound_head() more widely, so move it to the top of gup.c. Also fix a tiny spelling error and a checkpatch.pl warning. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup.c | 29

[PATCH v12 20/22] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2020-01-07 Thread John Hubbard
1. Convert from get_user_pages() to pin_user_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- arch/powerpc/mm/book3s64/iommu_api.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH v12 19/22] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2020-01-07 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Tested-by: Alex Williamson Acked-by: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/v

[PATCH v12 15/22] drm/via: set FOLL_PIN via pin_user_pages_fast()

2020-01-07 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH v12 21/22] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2020-01-07 Thread John Hubbard
t;gup_flags & 1" phrases in the function calls. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 9 ++--- tools/testing/selftests/vm/gup_benchmark.c | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a

[PATCH v12 05/22] goldish_pipe: rename local pin_user_pages() routine

2020-01-07 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "goldfish_pin_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

[PATCH v12 00/22] mm/gup: prereqs to track dma-pinned pages: FOLL_PIN

2020-01-07 Thread John Hubbard
: https://lwn.net/Articles/774411/ [3] The trouble with get_user_pages() (Apr 30, 2018): https://lwn.net/Articles/753027/ Dan Williams (1): mm: Cleanup __put_devmap_managed_page() vs ->page_free() John Hubbard (21): mm/gup: factor out duplicate code from four routines mm/gup: move try_ge

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2020-01-06 Thread John Hubbard
se cycle, so I'm probably going to submit the prerequisite patches (patches 1-10, or more boldly, 1-22), for candidates for 5.6. thanks, -- John Hubbard NVIDIA

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-28 Thread John Hubbard
On 12/27/19 1:56 PM, John Hubbard wrote: ... >> It is ancient verification test (~10y) which is not an easy task to >> make it understandable and standalone :). >> > > Is this the only test that fails, btw? No other test failures or hints of > problems? > > (Also

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-27 Thread John Hubbard
be attempted independently of (1), in order to see if it ends up hiding the repro. I've updated this branch to implement (1), but not (2), hoping you can give this one a spin? g...@github.com:johnhubbard/linux.git pin_user_pages_tracking_v11_with_diags thanks, -- John Hubbard NVI

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-24 Thread John Hubbard
On 12/22/19 5:23 AM, Leon Romanovsky wrote: On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote: On 12/20/19 10:29 AM, Leon Romanovsky wrote: ... $ ./build.sh $ build/bin/run_tests.py If you get things that far I think Leon can get a reproduction for you I'm not so optimistic

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-21 Thread John Hubbard
On 12/21/19 2:08 AM, Leon Romanovsky wrote: On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote: On 12/20/19 10:29 AM, Leon Romanovsky wrote: ... $ ./build.sh $ build/bin/run_tests.py If you get things that far I think Leon can get a reproduction for you I'm not so optimistic

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread John Hubbard
On 12/20/19 4:51 PM, Dan Williams wrote: > On Fri, Dec 20, 2019 at 4:41 PM John Hubbard wrote: >> >> On 12/20/19 4:33 PM, Dan Williams wrote: >> ... >>>> I believe there might be also a different solution for this: For >>>> transparent huge pages,

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread John Hubbard
sy is it for mere mortals outside of Intel, to set up a DAX (nvdimm?) test setup? I'd hate to go into this without having that coverage up and running. It's been sketchy enough as it is. :) thanks, -- John Hubbard NVIDIA

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread John Hubbard
rting to think that I should just post the first 9 or so prerequisite patches (first 9 patches, plus the v4l2 fix that arguably should have been earlier in the sequence I guess), as 5.6 candidates, while I go back to the drawing board here. thanks, -- John Hubbard NVIDIA

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread John Hubbard
npin_user_page(struct page *page); void unpin_user_pages_dirty_lock(struct page **pages, unsigned long npages, If that fails to repro, then we would be zeroing in on the root cause. The branch is here (I just tested it and it seems healthy): g...@github.com:johnhubbard/linux.git pin_user_pages_tracking_v11_with_diags thanks, -- John Hubbard NVIDIA

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-20 Thread John Hubbard
27;m very curious how did you get this assert "d.speed_to_str" covers all > known speeds according to the IBTA. > Hi Leon, Short answer: I can make that one pass, with a small fix the the rdma-core test suite: commit a1b9fb0846e1b2356d7a16f4fbdd1960cf8dcbe5 (HEAD -> fix_speed

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-19 Thread John Hubbard
_work/rdma-core/tests/test_device.py", line 113, in verify_port_attr assert 'Invalid' not in d.speed_to_str(attr.active_speed) AssertionError ------ Ran 67 tests in 10.058s FAILED (failures=1, skipped=3) thanks, -- John Hubbard NVIDIA

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-19 Thread John Hubbard
On 12/19/19 1:07 PM, Jason Gunthorpe wrote: On Thu, Dec 19, 2019 at 12:30:31PM -0800, John Hubbard wrote: On 12/19/19 5:26 AM, Leon Romanovsky wrote: On Mon, Dec 16, 2019 at 02:25:12PM -0800, John Hubbard wrote: Hi, This implements an API naming change (put_user_page*() --> unpin_user_p

Re: [PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-19 Thread John Hubbard
On 12/19/19 5:26 AM, Leon Romanovsky wrote: On Mon, Dec 16, 2019 at 02:25:12PM -0800, John Hubbard wrote: Hi, This implements an API naming change (put_user_page*() --> unpin_user_page*()), and also implements tracking of FOLL_PIN pages. It extends that tracking to a few select subsyst

Re: [PATCH v11 04/25] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-12-18 Thread John Hubbard
On 12/18/19 10:52 PM, Dan Williams wrote: On Wed, Dec 18, 2019 at 9:51 PM John Hubbard wrote: On 12/18/19 9:27 PM, Dan Williams wrote: ... @@ -461,5 +449,5 @@ void __put_devmap_managed_page(struct page *page) page->mapping = NULL; page->pgmap->ops->pa

Re: [PATCH v11 04/25] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-12-18 Thread John Hubbard
.glancing through the current callers, that doesn't look to be a problem. Good. So it should be OK to do EXPORT_SYMBOL_GPL here. Are you *sure* you don't want to just pre-emptively EXPORT now, and save looking at it again? thanks, -- John Hubbard NVIDIA

[PATCH v12] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-12-18 Thread John Hubbard
ra Weiny Signed-off-by: John Hubbard --- include/linux/mm.h | 18 +- mm/memremap.c | 16 ++-- mm/swap.c | 27 ++- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index c97ea3

Re: [PATCH v11 04/25] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-12-18 Thread John Hubbard
On 12/18/19 8:04 AM, Kirill A. Shutemov wrote: On Mon, Dec 16, 2019 at 02:25:16PM -0800, John Hubbard wrote: An upcoming patch changes and complicates the refcounting and especially the "put page" aspects of it. In order to keep everything clean, refactor the devmap page releas

Re: [PATCH v11 01/25] mm/gup: factor out duplicate code from four routines

2019-12-18 Thread John Hubbard
On 12/18/19 7:52 AM, Kirill A. Shutemov wrote: On Mon, Dec 16, 2019 at 02:25:13PM -0800, John Hubbard wrote: +static void put_compound_head(struct page *page, int refs) +{ + /* Do a get_page() first, in case refs == page->_refcount */ + get_page(page); + page_ref_sub(p

Re: [PATCH v11 06/25] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2019-12-18 Thread John Hubbard
nking it would be cleaner to put in the forward declaration, rather than moving code blocks, but either way seems reasonable. I'll go ahead and move the code blocks and delete the forward declaration, now that someone has weighed in in favor of that. thanks, -- John Hubbard NVIDIA

[PATCH v12 23/25] mm/gup: track FOLL_PIN pages

2019-12-17 Thread John Hubbard
t/Articles/753027/ Reviewed-by: Jan Kara Suggested-by: Jan Kara Suggested-by: Jérôme Glisse Cc: Kirill A. Shutemov Signed-off-by: John Hubbard --- Hi, The kbuild test robot noticed that try_pin_compound_head() can be declared static, in mm/gup.c. This updated patch does that. thanks, John Hubb

Re: [RFC PATCH] mm/gup: try_pin_compound_head() can be static

2019-12-17 Thread John Hubbard
page *page, + int refs) { struct page *head = try_get_compound_head(page, GUP_PIN_COUNTING_BIAS * refs); thanks, -- John Hubbard NVIDIA

[PATCH v11 25/25] selftests/vm: run_vmtests: invoke gup_benchmark with basic FOLL_PIN coverage

2019-12-16 Thread John Hubbard
s are fairly early in the run_vmtests script, because with test suites, it's usually preferable to put the shorter, faster tests first, all other things being equal. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- tools/testing/selftests/vm/run_vmtests | 22 ++ 1 fi

[PATCH v11 22/25] mm, tree-wide: rename put_user_page*() to unpin_user_page*()

2019-12-16 Thread John Hubbard
In order to provide a clearer, more symmetric API for pinning and unpinning DMA pages. This way, pin_user_pages*() calls match up with unpin_user_pages*() calls, and the API is a lot closer to being self-explanatory. Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- Documentation/core-api

[PATCH v11 07/25] vfio: fix FOLL_LONGTERM use, simplify get_user_pages_remote() call

2019-12-16 Thread John Hubbard
's no need for it at the VFIO call site. So remove it. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Glisse Signed-off-by: John Hubbard --- drivers/vfi

[PATCH v11 12/25] IB/{core, hw, umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP

2019-12-16 Thread John Hubbard
ned-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 2 +- drivers/infiniband/core/umem_odp.c | 13 ++--- drivers/infiniband/hw/hfi1/user_pages.c | 2 +- drivers/infiniband/hw/mthca/mthca_memfree.c | 2 +- drivers/infiniband/hw/qib/qib_user_pag

[PATCH v11 17/25] media/v4l2-core: set pages dirty upon releasing DMA buffers

2019-12-16 Thread John Hubbard
lling set_page_dirty_lock() if the CPU pages were potentially receiving data from the device. Reviewed-by: Christoph Hellwig Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: Signed-off-by: John Hubbard --- drivers/media/v4l2-core/videobuf-dma-sg.c | 5 - 1 file changed, 4 insertions(+), 1 del

[PATCH v11 21/25] mm/gup_benchmark: use proper FOLL_WRITE flags instead of hard-coding "1"

2019-12-16 Thread John Hubbard
t;gup_flags & 1" phrases in the function calls. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 9 ++--- tools/testing/selftests/vm/gup_benchmark.c | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a

[PATCH v11 23/25] mm/gup: track FOLL_PIN pages

2019-12-16 Thread John Hubbard
t/Articles/753027/ Reviewed-by: Jan Kara Suggested-by: Jan Kara Suggested-by: Jérôme Glisse Cc: Kirill A. Shutemov Signed-off-by: John Hubbard --- Documentation/core-api/pin_user_pages.rst | 2 +- include/linux/mm.h| 83 - include/linux/mmzone.h

[PATCH v11 15/25] fs/io_uring: set FOLL_PIN via pin_user_pages()

2019-12-16 Thread John Hubbard
: John Hubbard --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 9b1833fedc5c..c6ff9cc7fe71 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4539,7 +4539,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void

[PATCH v11 20/25] powerpc: book3s64: convert to pin_user_pages() and put_user_page()

2019-12-16 Thread John Hubbard
1. Convert from get_user_pages() to pin_user_pages(). 2. As required by pin_user_pages(), release these pages via put_user_page(). Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- arch/powerpc/mm/book3s64/iommu_api.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH v11 08/25] mm/gup: allow FOLL_FORCE for get_user_pages_fast()

2019-12-16 Thread John Hubbard
_FORCE to be set for get_user_pages_fast(). Fixes: 817be129e6f2 ("mm: validate get_user_pages_fast flags") Cc: Christoph Hellwig Reviewed-by: Leon Romanovsky Reviewed-by: Jan Kara Signed-off-by: John Hubbard --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[PATCH v11 16/25] net/xdp: set FOLL_PIN via pin_user_pages()

2019-12-16 Thread John Hubbard
convert from the get_user_pages()/put_page() model, to the pin_user_pages()/put_user_page() model, the only change required here is to change get_user_pages() to pin_user_pages(). Acked-by: Björn Töpel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v11 10/25] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-12-16 Thread John Hubbard
timil Babka for explaining the 4 cases in this documentation. (I've reworded it and expanded upon it.) Reviewed-by: Jan Kara Reviewed-by: Mike Rapoport # Documentation Reviewed-by: Jérôme Glisse Cc: Jonathan Corbet Cc: Ira Weiny Signed-off-by: John Hubbard --- Documentatio

[PATCH v11 05/25] goldish_pipe: rename local pin_user_pages() routine

2019-12-16 Thread John Hubbard
1. Avoid naming conflicts: rename local static function from "pin_user_pages()" to "goldfish_pin_pages()". An upcoming patch will introduce a global pin_user_pages() function. Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John H

[PATCH v11 09/25] IB/umem: use get_user_pages_fast() to pin DMA pages

2019-12-16 Thread John Hubbard
Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/infiniband/core/umem.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 7a3b99597ead..214e87aa609d 100644 --- a/drivers

[PATCH v11 04/25] mm: devmap: refactor 1-based refcounting for ZONE_DEVICE pages

2019-12-16 Thread John Hubbard
wed-by: Dan Williams Reviewed-by: Jan Kara Signed-off-by: Ira Weiny Signed-off-by: John Hubbard --- include/linux/mm.h | 17 + mm/memremap.c | 16 ++-- mm/swap.c | 24 3 files changed, 39 insertions(+), 18 deletions(-) diff -

[PATCH v11 19/25] vfio, mm: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-12-16 Thread John Hubbard
[1] [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Tested-by: Alex Williamson Acked-by: Alex Williamson Signed-off-by: John Hubbard --- drivers/vfio/vfio_iommu_type1.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/v

[PATCH v11 18/25] media/v4l2-core: pin_user_pages (FOLL_PIN) and put_user_page() conversion

2019-12-16 Thread John Hubbard
1. Change v4l2 from get_user_pages() to pin_user_pages(). 2. Because all FOLL_PIN-acquired pages must be released via put_user_page(), also convert the put_page() call over to put_user_pages_dirty_lock(). Acked-by: Hans Verkuil Cc: Ira Weiny Signed-off-by: John Hubbard --- drivers/media/v4l2

[PATCH v11 24/25] mm/gup_benchmark: support pin_user_pages() and related calls

2019-12-16 Thread John Hubbard
_user_pages(), check each page: if page_dma_pinned() returns false, then WARN and return. Do this outside of the benchmark timestamps, so that it doesn't affect reported times. Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/gup_benchmark.c | 65 +++

[PATCH v11 00/25] mm/gup: track dma-pinned pages: FOLL_PIN

2019-12-16 Thread John Hubbard
r_pages() (LPC: Dec 12, 2018): https://lwn.net/Articles/774411/ [3] The trouble with get_user_pages() (Apr 30, 2018): https://lwn.net/Articles/753027/ Dan Williams (1): mm: Cleanup __put_devmap_managed_page() vs ->page_free() John Hubbard (24): mm/gup: factor out duplicate code from four rout

[PATCH v11 01/25] mm/gup: factor out duplicate code from four routines

2019-12-16 Thread John Hubbard
e the successful end of each routine, to increment *nr. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Reviewed-by: Jan Kara Cc: Ira Weiny Cc: Christoph Hellwig Cc: Aneesh Kumar K.V Signed-off-by: John Hubbard --- mm/gup.c | 91 ++

[PATCH v11 06/25] mm: fix get_user_pages_remote()'s handling of FOLL_LONGTERM

2019-12-16 Thread John Hubbard
Thanks to Jason Gunthorpe for pointing out a clean way to fix this, and to Dan Williams for helping clarify the DAX refactoring. Tested-by: Alex Williamson Acked-by: Alex Williamson Reviewed-by: Jason Gunthorpe Reviewed-by: Ira Weiny Suggested-by: Jason Gunthorpe Cc: Dan Williams Cc: Jerome Gl

[PATCH v11 13/25] mm/process_vm_access: set FOLL_PIN via pin_user_pages_remote()

2019-12-16 Thread John Hubbard
or easier reading of process_vm_rw_single_vec(). Reviewed-by: Jan Kara Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- mm/process_vm_access.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/proc

[PATCH v11 14/25] drm/via: set FOLL_PIN via pin_user_pages_fast()

2019-12-16 Thread John Hubbard
: Ira Weiny Signed-off-by: John Hubbard --- drivers/gpu/drm/via/via_dmablit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_dmablit.c b/drivers/gpu/drm/via/via_dmablit.c index 3db000aacd26..37c5e572993a 100644 --- a/drivers/gpu/drm/via/via_dmablit.c

[PATCH v11 11/25] goldish_pipe: convert to pin_user_pages() and put_user_page()

2019-12-16 Thread John Hubbard
instead of here, so just delete the local release_user_pages() entirely, and call put_user_pages_dirty_lock() directly, instead. [1] https://lore.kernel.org/r/20190723153640.gb...@lst.de Reviewed-by: Jan Kara Reviewed-by: Ira Weiny Signed-off-by: John Hubbard --- drivers/platform/goldfish/goldf

[PATCH v11 03/25] mm: Cleanup __put_devmap_managed_page() vs ->page_free()

2019-12-16 Thread John Hubbard
p is only needed in the MEMORY_DEVICE_FSDAX case, but it does no harm in the MEMORY_DEVICE_DEVDAX and MEMORY_DEVICE_PCI_P2PDMA case. Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Cc: Jan Kara Cc: Ira Weiny Signed-off-by: Dan Williams Signed-off-by: John Hubbard --- drivers/nvdimm/pm

  1   2   3   4   5   >