Re: [PATCH 07/19] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*()

2019-10-31 Thread Ira Weiny
e are going to need a lot more documentation on which flags are "user" accessible vs not... Reviewed-by: Ira Weiny > Signed-off-by: John Hubbard > --- > drivers/infiniband/core/umem.c | 5 ++--- > drivers/infiniband/core/umem_odp.c | 10 +-

Re: [PATCH 05/19] mm/gup: introduce pin_user_pages*() and FOLL_PIN

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:16PM -0700, John Hubbard wrote: > Introduce pin_user_pages*() variations of get_user_pages*() calls, > and also pin_longterm_pages*() variations. > > These variants all set FOLL_PIN, which is also introduced, and > basically documented. (An upcoming patch provides

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: > On 10/31/19 11:35 AM, Ira Weiny wrote: > > On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > ... > >> + > >> +static void __remove_refs_from_head(struct page *page, int refs) > >&

Re: [PATCH 03/19] goldish_pipe: rename local pin_user_pages() routine

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:14PM -0700, John Hubbard wrote: > 1. Avoid naming conflicts: rename local static function from > "pin_user_pages()" to "pin_goldfish_pages()". > > An upcoming patch will introduce a global pin_user_pages() > function. >

Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: > There are four locations in gup.c that have a fair amount of code > duplication. This means that changing one requires making the same > changes in four places, not to mention reading the same code four > times, and wondering if there

Re: [PATCH 01/19] mm/gup: pass flags arg to __gup_device_* functions

2019-10-31 Thread Ira Weiny
On Wed, Oct 30, 2019 at 03:49:12PM -0700, John Hubbard wrote: > A subsequent patch requires access to gup flags, so > pass the flags argument through to the __gup_device_* > functions. > > Also placate checkpatch.pl by shortening a nearby line. > Reviewed-by: Ira We

Re: [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-07 Thread Ira Weiny
On Wed, Aug 07, 2019 at 10:46:49AM +0200, Michal Hocko wrote: > On Wed 07-08-19 10:37:26, Jan Kara wrote: > > On Fri 02-08-19 12:14:09, John Hubbard wrote: > > > On 8/2/19 7:52 AM, Jan Kara wrote: > > > > On Fri 02-08-19 07:24:43, Matthew Wilcox wrote: > > > > > On Fri, Aug 02, 2019 at 02:41:46PM

Re: [PATCH v6 1/3] mm/gup: add make_dirty arg to put_user_pages_dirty_lock()

2019-08-06 Thread Ira Weiny
equired. > > Reviewed-by: Christoph Hellwig > Cc: Matthew Wilcox > Cc: Jan Kara > Cc: Ira Weiny > Cc: Jason Gunthorpe > Signed-off-by: John Hubbard I assume this is superseded by the patch in the large series? Ira > --- > drivers/infiniband/core/umem.c

Re: [PATCH v2 01/34] mm/gup: add make_dirty arg to put_user_pages_dirty_lock()

2019-08-06 Thread Ira Weiny
equired. > > Reviewed-by: Christoph Hellwig > Cc: Matthew Wilcox > Cc: Jan Kara > Cc: Ira Weiny > Cc: Jason Gunthorpe > Signed-off-by: John Hubbard > --- > drivers/infiniband/core/umem.c | 5 +- > drivers/infiniband/hw/hfi1/user_pages.c

Re: [PATCH 3/3] net/xdp: convert put_page() to put_user_page*()

2019-07-23 Thread Ira Weiny
On Mon, Jul 22, 2019 at 09:41:34PM -0700, John Hubbard wrote: > On 7/22/19 5:25 PM, Ira Weiny wrote: > > On Mon, Jul 22, 2019 at 03:34:15PM -0700, john.hubb...@gmail.com wrote: > > > From: John Hubbard > > > > > > For pages that were retained via get_user_pag

Re: [PATCH 3/3] net/xdp: convert put_page() to put_user_page*()

2019-07-22 Thread Ira Weiny
On Mon, Jul 22, 2019 at 03:34:15PM -0700, 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 > release_pages(). > > This is part a tree-wide

Re: [PATCH 17/25] PCI/P2PDMA: use the dev_pagemap internal refcount

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:16PM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > p2pdma.c. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/pci/p2pdma.c | 57 ---

Re: [PATCH 16/25] device-dax: use the dev_pagemap internal refcount

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 02:27:15PM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/dax/dax-private.h | 4 > drivers/d

Re: [PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap

2019-06-26 Thread Ira Weiny
TR(-EINVAL); > + if (!pgmap->ref) { > + if (pgmap->ops && (pgmap->ops->kill || pgmap->ops->cleanup)) > + return ERR_PTR(-EINVAL); > + > + init_completion(>done); > + error = percpu_ref_init(>int

Re: [PATCH 24/25] mm: remove the HMM config option

2019-06-26 Thread Ira Weiny
> pretty portable. > > Signed-off-by: Christoph Hellwig Seems reasonable to me. Reviewed-by: Ira Weiny > --- > drivers/gpu/drm/nouveau/Kconfig | 3 +-- > include/linux/hmm.h | 5 + > include/linux/mm_types.h| 2 +- > mm/

Re: [PATCH 23/25] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-26 Thread Ira Weiny
ny setups, > and depend on it instead. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/gpu/drm/nouveau/Kconfig | 2 +- > mm/Kconfig | 5 ++--- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/d

Re: [PATCH 14/25] memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag

2019-06-26 Thread Ira Weiny
map using > it. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > arch/powerpc/mm/mem.c | 10 +- > arch/x86/mm/init_64.c | 8 ++-- > drivers/nvdimm/pfn_devs.c | 3 +-- > drivers/nvdimm/pmem.c | 1 - > include/linux/memremap.h |

Re: [PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-26 Thread Ira Weiny
; > +static atomic_t devmap_managed_enable; > + > +static void devmap_managed_enable_put(void *data) > +{ > + if (atomic_dec_and_test(_managed_enable)) > + static_branch_disable(_managed_key); > +} > + > +static int devmap_managed_enable_get(struct device *

Re: [PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 10:14:45AM -0700, 'Ira Weiny' wrote: > On Wed, Jun 26, 2019 at 09:00:47AM -0700, Dan Williams wrote: > > [ add Ira ] > > > > On Wed, Jun 26, 2019 at 5:27 AM Christoph Hellwig wrote: > > > > > > The code hasn't been used sinc

Re: [PATCH 08/25] memremap: validate the pagemap type passed to devm_memremap_pages

2019-06-26 Thread Ira Weiny
ice dax gets replaced with an explicit MEMORY_DEVICE_DEVDAX type. > > Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny > --- > drivers/dax/device.c | 1 + > include/linux/memremap.h | 8 > kernel/memremap.c| 22 ++ >

Re: [PATCH 04/25] mm: remove MEMORY_DEVICE_PUBLIC support

2019-06-26 Thread Ira Weiny
On Wed, Jun 26, 2019 at 09:00:47AM -0700, Dan Williams wrote: > [ add Ira ] > > On Wed, Jun 26, 2019 at 5:27 AM Christoph Hellwig wrote: > > > > The code hasn't been used since it was added to the tree, and doesn't > > appear to actually be usable. > > > > Signed-off-by: Christoph Hellwig > >

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 07:58:29PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: > > > > On 6/13/19 12:44 PM, Jason Gunthorpe wrote: > > > On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > > > > The code hasn't been used since

Re: dev_pagemap related cleanups

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote: > > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > > > > > Hi Dan, Jérôme and Jason, > > > > > > below is a series that cleans up the dev_pagemap

Re: [PATCH 13/22] device-dax: use the dev_pagemap internal refcount

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 11:43:16AM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/dax-private.h | 4 --- > drivers/dax/device.c | 52

Re: [RFC] mm/hmm: pass mmu_notifier_range to sync_cpu_device_pagetables

2019-06-09 Thread Ira Weiny
ructure is a good simplification IMO. So... Reviewed-by: Ira Weiny > --- > > I'm sending this out now since we are updating many of the HMM APIs > and I think it will be useful. > > > drivers/gpu/drm/nouveau/nouveau_svm.c | 4 ++-- > include/linux/hmm.h

Re: [PATCH v2 hmm 10/11] mm/hmm: Do not use list*_rcu() for hmm->ranges

2019-06-07 Thread Ira Weiny
On Thu, Jun 06, 2019 at 03:44:37PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > This list is always read and written while holding hmm->lock so there is > no need for the confusing _rcu annotations. > > Signed-off-by: Jason Gunthorpe > Reviewed-by: Jérôme G

Re: [PATCH v2 hmm 09/11] mm/hmm: Poison hmm_range during unregister

2019-06-07 Thread Ira Weiny
+ > + /* The range is now invalid, leave it poisoned. */ > + range->valid = false; No need to set valid false again as you just did this 5 lines above. Reviewed-by: Ira Weiny > + memset(>hmm, POISON_INUSE, sizeof(range->hmm)); > } > EXPORT_SYMB

Re: [PATCH v3 hmm 05/11] mm/hmm: Remove duplicate condition test before wait_event_timeout

2019-06-07 Thread Ira Weiny
th. > - A valid hmm has a valid hmm->mm. > > Allowing the return value of wait_event_timeout() (along with its internal > barriers) to compute the result of the function. > > Signed-off-by: Jason Gunthorpe Reviewed-by: Ira Weiny > --- > v3 > - Simplify the wait_

Re: [PATCH v2 hmm 04/11] mm/hmm: Simplify hmm_get_or_create and make it reliable

2019-06-07 Thread Ira Weiny
xchange pattern. > > Also make the locking very easy to understand by only ever reading or > writing mm->hmm while holding the write side of the mmap_sem. > > Signed-off-by: Jason Gunthorpe Reviewed-by: Ira Weiny > --- > v2: > - Fix error unwind of mmgrab (Jerome) >

Re: [PATCH v2 hmm 03/11] mm/hmm: Hold a mmgrab from hmm to mm

2019-06-07 Thread Ira Weiny
t; > Since mmdrop() (ie a 0 kref on struct mm) is now impossible with a !NULL > mm->hmm delete the hmm_hmm_destroy(). > > Signed-off-by: Jason Gunthorpe > Reviewed-by: Jérôme Glisse Reviewed-by: Ira Weiny > --- > v2: > - Fix error unwind paths in hmm_get_or_creat

Re: [PATCH v2 hmm 02/11] mm/hmm: Use hmm_mirror not mm as an argument for hmm_range_register

2019-06-07 Thread Ira Weiny
> - > /* Check if hmm_mm_destroy() was call. */ > - if (hmm->mm == NULL || hmm->dead) { > - hmm_put(hmm); > + if (hmm->mm == NULL || hmm->dead) > return -EFAULT; > - } > + > + range->hmm = hmm; I don't think you

Re: [PATCH v6 7/8] mm/mmu_notifier: pass down vma and reasons why mmu notifier is happening v2

2019-04-11 Thread Ira Weiny
On Thu, Apr 11, 2019 at 08:41:30AM +0300, Leon Romanovsky wrote: > On Wed, Apr 10, 2019 at 04:41:57PM -0700, Ira Weiny wrote: > > On Tue, Mar 26, 2019 at 12:47:46PM -0400, Jerome Glisse wrote: > > > From: Jérôme Glisse > > > [snip] > > > diff --git a/include/

Re: [PATCH v6 7/8] mm/mmu_notifier: pass down vma and reasons why mmu notifier is happening v2

2019-04-10 Thread Ira Weiny
range->vma = vma; > + range->event = event; > range->mm = mm; > range->start = start; > range->end = end; > - range->flags = 0; > + range->flags = flags; Which of the "user patch sets" uses the new flags?

Re: [RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it

2019-02-27 Thread Ira Weiny
On Tue, Feb 19, 2019 at 09:30:33PM -0800, 'Ira Weiny' wrote: > From: Ira Weiny > > Resending these as I had only 1 minor comment which I believe we have covered > in this series. I was anticipating these going through the mm tree as they > depend on a cleanup patch there and

Re: [RESEND PATCH 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-02-21 Thread Ira Weiny
On Thu, Feb 21, 2019 at 08:48:41AM +0530, Souptick Joarder wrote: > Hi Ira, > > On Wed, Feb 20, 2019 at 11:01 AM wrote: > > > > From: Ira Weiny > > > > To facilitate additional options to get_user_pages_fast() change the > > singular write parameter t

Re: [RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it

2019-02-20 Thread Ira Weiny
On Wed, Feb 20, 2019 at 07:19:30AM -0800, Christoph Hellwig wrote: > On Tue, Feb 19, 2019 at 09:30:33PM -0800, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > Resending these as I had only 1 minor comment which I believe we have > > covered > > in

[RESEND PATCH 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-02-19 Thread ira . weiny
From: Ira Weiny To facilitate additional options to get_user_pages_fast() change the singular write parameter to be gup_flags. This patch does not change any functionality. New functionality will follow in subsequent patches. Some of the get_user_pages_fast() call sites were unchanged because

[RESEND PATCH 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM

2019-02-19 Thread ira . weiny
From: Ira Weiny Rather than have a separate get_user_pages_longterm() call, introduce FOLL_LONGTERM and change the longterm callers to use it. This patch does not change any functionality. FOLL_LONGTERM can only be supported with get_user_pages() as it requires vmas to determine if DAX

[RESEND PATCH 4/7] mm/gup: Add FOLL_LONGTERM capability to GUP fast

2019-02-19 Thread ira . weiny
From: Ira Weiny DAX pages were previously unprotected from longterm pins when users called get_user_pages_fast(). Use the new FOLL_LONGTERM flag to check for DEVMAP pages and fall back to regular GUP processing if a DEVMAP page is encountered. Signed-off-by: Ira Weiny --- mm/gup.c | 24

[RESEND PATCH 6/7] IB/qib: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/qib/qib_user_sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c

[RESEND PATCH 2/7] mm/gup: Change write parameter to flags in fast walk

2019-02-19 Thread ira . weiny
From: Ira Weiny In order to support more options in the GUP fast walk, change the write parameter to flags throughout the call stack. This patch does not change functionality and passes FOLL_WRITE where write was previously used. Signed-off-by: Ira Weiny --- mm/gup.c | 52

[RESEND PATCH 5/7] IB/hfi1: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/hfi1/user_pages.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/hfi1

[RESEND PATCH 7/7] IB/mthca: Use the new FOLL_LONGTERM flag to get_user_pages_fast()

2019-02-19 Thread ira . weiny
From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/mthca/mthca_memfree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mthca

[RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it

2019-02-19 Thread ira . weiny
From: Ira Weiny Resending these as I had only 1 minor comment which I believe we have covered in this series. I was anticipating these going through the mm tree as they depend on a cleanup patch there and the IB changes are very minor. But they could just as well go through the IB tree. NOTE

Re: [PATCH V2 0/7] Add FOLL_LONGTERM to GUP fast and use it

2019-02-16 Thread Ira Weiny via dri-devel
ange get_user_pages() to use the new FOLL_LONGTERM flag and > remove the specialized get_user_pages_longterm call. > > [1] https://lkml.org/lkml/2019/2/11/237 > [2] https://lkml.org/lkml/2019/2/11/1789 Any comments on this series? I've touched a lot of subsystems which I think require revi

Re: [PATCH V2 3/7] mm/gup: Change GUP fast to use flags rather than a write 'bool'

2019-02-13 Thread Ira Weiny via dri-devel
On Wed, Feb 13, 2019 at 04:11:10PM -0700, Jason Gunthorpe wrote: > On Wed, Feb 13, 2019 at 03:04:51PM -0800, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > To facilitate additional options to get_user_pages_fast() change the > > singular write parameter to b

<    1   2   3