Just use devm_memremap_pages instead of hmm_devmem_add pages to allow
killing that wrapper which doesn't provide a whole lot of benefits.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 80 --
1 file changed, 38 insertions(+), 42 dele
Provide an internal refcounting logic if no ->ref field is provided
in the pagemap passed into devm_memremap_pages so that callers don't
have to reinvent it poorly.
Signed-off-by: Christoph Hellwig
---
include/linux/memremap.h | 4 +++
kernel/memremap.c
The ZONE_DEVICE support doesn't depend on anything HMM related, just on
various bits of arch support as indicated by the architecture. Also
don't select the option from nouveau as it isn't present in many setups,
and depend on it instead.
Signed-off-by: Christoph Hellwig
---
Just check if there is a ->page_free operation set and take care of the
static key enable, as well as the put using device managed resources.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c | 23 +++--
include/linux/mm.h| 10
kernel/memremap.c |
The code hasn't been used since it was added to the tree, and doesn't
appear to actually be usable. Mark it as BROKEN until either a user
comes along or we finally give up on it.
Signed-off-by: Christoph Hellwig
---
mm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/Kc
There isn't really much value add in the hmm_devmem_add wrapper. Just
factor out a little helper to find the resource, and otherwise let the
driver implement the dev_pagemap_ops directly.
Signed-off-by: Christoph Hellwig
---
Documentation/vm/hmm.rst | 26
include/linux/
The migrate_vma helper is only used by noveau to migrate device private
pages around. Other HMM_MIRROR users like amdgpu or infiniband don't
need it.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/Kconfig | 1 +
mm/Kconfig | 1 -
2 files changed, 1 inse
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau
depend on it instead of the mix of a dummy dependency symbol plus the
actually selected one. Drop various odd dependencies, as the code is
pretty portable.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau
struct dev_pagemap is always embedded into a containing structure, so
there is no need to an additional private data field.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c| 2 +-
include/linux/memremap.h | 3 +--
kernel/memremap.c| 2 +-
mm/hmm.c | 9
This replaces the hacky ->fault callback, which is currently directly
called from common code through a hmm specific data structure as an
exercise in layering violations.
Signed-off-by: Christoph Hellwig
---
include/linux/hmm.h | 6 --
include/linux/memremap.h | 6 ++
incl
Remove the clumsy hmm_devmem_page_{get,set}_drvdata helpers, and
instead just access the page directly. Also make the page data
a void pointer, and thus much easier to use.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 18 +++--
include/linux/hmm.h
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote:
> > Perhaps we should pull those out and resend them through hmm.git?
>
> It could be done - but how bad is the conflict resolution?
Trivial. All but one patch just apply using git-am, and the other one
just has a few lines of offs
On Thu, Jun 13, 2019 at 02:16:27PM +, Jason Gunthorpe wrote:
> On Thu, Jun 13, 2019 at 11:43:03AM +0200, Christoph Hellwig wrote:
> > Hi Dan, Jérôme and Jason,
> >
> > below is a series that cleans up the dev_pagemap interface so that
> > it is more easily usable
On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote:
> It also turns out the nvdimm unit tests crash with this signature on
> that branch where base v5.2-rc3 passes:
How do you run that test?
___
Nouveau mailing list
Nouveau@lists.freedesktop.or
On Thu, Jun 13, 2019 at 11:10:45PM +, Jason Gunthorpe wrote:
> Okay, NP then, trivial ones are OK to send to Linus..
>
> If Andrew gets them into -rc5 then I will get rc5 into hmm.git next
> week.
If I interpret Andrews mails from last night correctly he just sent
them to Linus.
_
On Thu, Jun 13, 2019 at 06:52:44PM +, Jason Gunthorpe wrote:
> On Thu, Jun 13, 2019 at 11:43:06AM +0200, Christoph Hellwig wrote:
> > This function has never been used since it was first added to the kernel
> > more than a year and a half ago, and if we ever grow a
On Thu, Jun 13, 2019 at 07:05:07PM +, Jason Gunthorpe wrote:
> Hurm, is hmm following this comment from mm_types.h?
>
> * If you allocate the page using alloc_pages(), you can use some of the
> * space in struct page for your own purposes. The five words in the main
> * union are available
On Thu, Jun 13, 2019 at 06:47:57PM -0700, John Hubbard wrote:
> On 6/13/19 2:43 AM, Christoph Hellwig wrote:
> > noveau is currently using this through an odd hmm wrapper, and I plan
>
> "nouveau"
Meh, I keep misspelling that name. I've already fixed it up a f
On Thu, Jun 13, 2019 at 07:16:35PM +, Jason Gunthorpe wrote:
> I wonder if IORES_DESC_DEVICE_PRIVATE_MEMORY should be a function
> argument?
No. The only reason to use this function is to allocate the fake
physical address space for the device private memory case. If you'd
deal with real res
On Thu, Jun 13, 2019 at 07:34:31PM +, Jason Gunthorpe wrote:
> Reviewed-by: Christoph Hellwig
Really? :)
On Thu, Jun 13, 2019 at 04:42:07PM -0700, Ralph Campbell wrote:
> This needs to either initialize "page" or be changed to "vmf->page".
> Otherwise, it is a NULL pointer dereference.
Thanks, fixed.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
ht
On Thu, Jun 13, 2019 at 05:22:17PM -0700, Ira Weiny wrote:
> > - dev_dax->pgmap.ref = &dev_dax->ref;
>
> I don't think this exactly correct. pgmap.ref is a pointer to the dev_dax ref
> structure. Taking it away will cause devm_memremap_pages() to fail AFAICS.
>
> I think you need to change st
On Thu, Jun 13, 2019 at 07:42:43PM +, Jason Gunthorpe wrote:
> On Thu, Jun 13, 2019 at 11:43:20AM +0200, Christoph Hellwig wrote:
> > There isn't really much value add in the hmm_devmem_add wrapper. Just
> > factor out a little helper to find the resource, and otherwis
On Thu, Jun 13, 2019 at 05:43:15PM -0700, Ira Weiny wrote:
> yes but the earlier patch:
>
> [PATCH 03/22] mm: remove hmm_devmem_add_resource
>
> Removes the only place type is set to MEMORY_DEVICE_PUBLIC.
>
> So I think it is ok. Frankly I was wondering if we should remove the public
> type a
On Thu, Jun 13, 2019 at 08:01:55PM +, Jason Gunthorpe wrote:
> On Thu, Jun 13, 2019 at 11:43:24AM +0200, Christoph Hellwig wrote:
> > All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau
> > depend on it instead of the mix of a dummy dependency symbol plus t
On Thu, Jun 13, 2019 at 06:53:15PM -0700, John Hubbard wrote:
> For those who have out of tree drivers that need migrate_vma(), but are not
> Nouveau, could we pretty please allow a way to select that independently?
No. The whole point is to not build this fairly big chunk of code in
unless we ha
On Fri, Jun 14, 2019 at 06:14:45PM -0700, Dan Williams wrote:
> On Thu, Jun 13, 2019 at 11:14 PM Christoph Hellwig wrote:
> >
> > On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote:
> > > It also turns out the nvdimm unit tests crash with this signature on
>
On Fri, Jun 14, 2019 at 07:21:54PM -0700, John Hubbard wrote:
> On 6/13/19 2:43 AM, Christoph Hellwig wrote:
> > Keep the physical address allocation that hmm_add_device does with the
> > rest of the resource code, and allow future reuse of it without the hmm
> > wrapper.
&
This function has never been used since it was first added to the kernel
more than a year and a half ago, and if we ever grow a consumer of the
MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages
directly.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Hi Dan, Jérôme and Jason,
below is a series that cleans up the dev_pagemap interface so that
it is more easily usable, which removes the need to wrap it in hmm
and thus allowing to kill a lot of code
Note: this series is on top of the rdma/hmm branch + the dev_pagemap
releas fix series from Dan t
ee).
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: John Hubbard
---
mm/hmm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index dc251c51803a..64e788bb1211 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -1380,8 +1380,6 @@ static void hmm_devmem_free(stru
nouveau is currently using this through an odd hmm wrapper, and I plan
to switch it to the real thing later in this series.
Signed-off-by: Christoph Hellwig
Reviewed-by: John Hubbard
---
mm/mempolicy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index
Most pgmap types are only supported when certain config options are
enabled. Check for a type that is valid for the current configuration
before setting up the pagemap.
Signed-off-by: Christoph Hellwig
---
kernel/memremap.c | 27 +++
1 file changed, 27 insertions
Passing the actual typed structure leads to more understandable code
vs just passing the ref member.
Reported-by: Logan Gunthorpe
Signed-off-by: Christoph Hellwig
Reviewed-by: Logan Gunthorpe
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
drivers/dax/device.c | 12
struct dev_pagemap is always embedded into a containing structure, so
there is no need to an additional private data field.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/nvdimm/pmem.c| 2 +-
include/linux/memremap.h | 3 +--
kernel/memremap.c| 2 +-
mm
Keep the physical address allocation that hmm_add_device does with the
rest of the resource code, and allow future reuse of it without the hmm
wrapper.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: John Hubbard
---
include/linux/ioport.h | 2 ++
kernel/resource.c
The dev_pagemap is a growing too many callbacks. Move them into a
separate ops structure so that they are not duplicated for multiple
instances, and an attacker can't easily overwrite them.
Signed-off-by: Christoph Hellwig
Reviewed-by: Logan Gunthorpe
Reviewed-by: Jason Gunthorpe
---
dr
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
mm/Kconfig | 10 --
1 file changed, 10 deletions(-)
diff --git a/mm/Kconfig b/mm/Kconfig
index f0c76ba47695..0d2ba7e1f43e 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -675,16 +675,6 @@ config ARCH_HAS_HMM_MIRROR
Provide an internal refcounting logic if no ->ref field is provided
in the pagemap passed into devm_memremap_pages so that callers don't
have to reinvent it poorly.
Signed-off-by: Christoph Hellwig
---
include/linux/memremap.h | 4 ++
kernel/memremap.c
This replaces the hacky ->fault callback, which is currently directly
called from common code through a hmm specific data structure as an
exercise in layering violations.
Signed-off-by: Christoph Hellwig
Reviewed-by: Ralph Campbell
---
include/linux/hmm.h | 6 --
include/li
s also fixes the fact that hmm never called
dev_pagemap_put_ops and thus would leave the slow path enabled forever,
even after a device driver unload or disable.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c | 23 +++--
include/linux/mm.h| 10
kernel/memr
This code is a trivial wrapper around device model helpers, which
should have been integrated into the driver device model usage from
the start. Assuming it actually had users, which it never had since
the code was added more than 1 1/2 years ago.
Signed-off-by: Christoph Hellwig
Reviewed-by
Add a flags field to struct dev_pagemap to replace the altmap_valid
boolean to be a little more extensible. Also add a pgmap_altmap() helper
to find the optional altmap and clean up the code using the altmap using
it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/mm/mem.c | 10
The migrate_vma helper is only used by noveau to migrate device private
pages around. Other HMM_MIRROR users like amdgpu or infiniband don't
need it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/gpu/drm/nouveau/Kconfig | 1 +
mm/Kconfig
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 | 43 ---
2 files changed, 47 deletions(-)
diff --git a/drivers/dax/dax
Remove the clumsy hmm_devmem_page_{get,set}_drvdata helpers, and
instead just access the page directly. Also make the page data
a void pointer, and thus much easier to use.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 18 +++--
include/linux/hmm.h
The only user of it has just been removed, and there wasn't really any need
to wrap a basic memory allocator to start with.
Signed-off-by: Christoph Hellwig
---
include/linux/hmm.h | 3 ---
mm/hmm.c| 14 --
2 files changed, 17 deletions(-)
diff --git a/include/
The code hasn't been used since it was added to the tree, and doesn't
appear to actually be usable. Mark it as BROKEN until either a user
comes along or we finally give up on it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
mm/Kconfig | 1 +
1 file changed, 1
The ZONE_DEVICE support doesn't depend on anything HMM related, just on
various bits of arch support as indicated by the architecture. Also
don't select the option from nouveau as it isn't present in many setups,
and depend on it instead.
Signed-off-by: Christoph Hellwig
---
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau
depend on it instead of the mix of a dummy dependency symbol plus the
actually selected one. Drop various odd dependencies, as the code is
pretty portable.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau
There isn't really much value add in the hmm_devmem_add wrapper and
more, as using devm_memremap_pages directly now is just as simple.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
Documentation/vm/hmm.rst | 26
include/linux/hmm.h
Just use devm_memremap_pages instead of hmm_devmem_add pages to allow
killing that wrapper which doesn't provide a whole lot of benefits.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 82 --
1 file changed, 38 insertions(+), 44 dele
The functionality is identical to the one currently open coded in
p2pdma.c.
Signed-off-by: Christoph Hellwig
---
drivers/pci/p2pdma.c | 56
1 file changed, 4 insertions(+), 52 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
hmm_vma_alloc_locked_page is scheduled to go away, use the proper
mm function directly.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau
On Mon, Jun 17, 2019 at 10:37:12AM -0700, Dan Williams wrote:
> > +struct resource *devm_request_free_mem_region(struct device *dev,
> > + struct resource *base, unsigned long size);
>
> This appears to need a 'static inline' helper stub in the
> CONFIG_DEVICE_PRIVATE=n case, otherwi
On Mon, Jun 17, 2019 at 07:40:18PM +0200, Christoph Hellwig wrote:
> On Mon, Jun 17, 2019 at 10:37:12AM -0700, Dan Williams wrote:
> > > +struct resource *devm_request_free_mem_region(struct device *dev,
> > > + struct resource *base, unsigned long size);
>
On Mon, Jun 17, 2019 at 12:02:09PM -0700, Dan Williams wrote:
> Need a lead in patch that introduces MEMORY_DEVICE_DEVDAX, otherwise:
Or maybe a MEMORY_DEVICE_DEFAULT = 0 shared by fsdax and p2pdma?
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
On Mon, Jun 17, 2019 at 10:51:35AM -0700, Dan Williams wrote:
> > - struct dev_pagemap *pgmap = _pgmap;
>
> Whoops, needed to keep this line to avoid:
>
> tools/testing/nvdimm/test/iomap.c:109:11: error: ‘pgmap’ undeclared
> (first use in this function); did you mean ‘_pgmap’?
So I really
On Mon, Jun 17, 2019 at 02:08:14PM -0600, Logan Gunthorpe wrote:
> I just noticed this is missing a line to set pgmap->ops to
> pci_p2pdma_pagemap_ops. I must have gotten confused by the other users
> in my original review. Though I'm not sure how this compiles as the new
> struct is static and unu
On Tue, Jun 18, 2019 at 12:47:10PM -0700, Dan Williams wrote:
> > Git tree:
> >
> > git://git.infradead.org/users/hch/misc.git hmm-devmem-cleanup.2
> >
> > Gitweb:
> >
> >
> > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/hmm-devmem-cleanup.2
>
> Attached is my incremen
On Wed, Jun 19, 2019 at 03:19:23PM -0300, Jason Gunthorpe wrote:
> > Just make sure that when you backmerge v5.2-rc5 you have a clear
> > reason in the merge commit message about why you needed to do it.
> > While needless rebasing is top of the pet peeve list, second place, as
> > I found out, is
On Mon, Jun 24, 2019 at 11:24:48AM -0700, Dan Williams wrote:
> I asked for this simply because it was not exported historically. In
> general I want to establish explicit export-type criteria so the
> community can spend less time debating when to use EXPORT_SYMBOL_GPL
> [1].
>
> The thought in t
On Thu, Jun 20, 2019 at 09:26:48PM +0200, Michal Hocko wrote:
> On Thu 13-06-19 11:43:21, Christoph Hellwig wrote:
> > The code hasn't been used since it was added to the tree, and doesn't
> > appear to actually be usable. Mark it as BROKEN until either a user
> >
On Tue, Jun 25, 2019 at 11:44:28AM +, Jason Gunthorpe wrote:
> Which tree and what does the resolution look like?
Looks like in -mm. The current commit in linux-next is:
commit 0d23b042f26955fb35721817beb98ba7f1d9ed9f
Author: Robin Murphy
Date: Fri Jun 14 10:42:14 2019 +1000
mm: clea
ee).
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: John Hubbard
---
mm/hmm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index 376159a769fb..e7dd2ab8f9ab 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -1383,8 +1383,6 @@ static void hmm_devmem_free(stru
The dev_pagemap is a growing too many callbacks. Move them into a
separate ops structure so that they are not duplicated for multiple
instances, and an attacker can't easily overwrite them.
Signed-off-by: Christoph Hellwig
Reviewed-by: Logan Gunthorpe
Reviewed-by: Jason Gunthorpe
---
dr
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
mm/Kconfig | 10 --
1 file changed, 10 deletions(-)
diff --git a/mm/Kconfig b/mm/Kconfig
index f0c76ba47695..0d2ba7e1f43e 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -675,16 +675,6 @@ config ARCH_HAS_HMM_MIRROR
s also fixes the fact that hmm never called
dev_pagemap_put_ops and thus would leave the slow path enabled forever,
even after a device driver unload or disable.
Signed-off-by: Christoph Hellwig
---
drivers/nvdimm/pmem.c | 23 +++--
include/linux/mm.h| 10
kernel/memr
Keep the physical address allocation that hmm_add_device does with the
rest of the resource code, and allow future reuse of it without the hmm
wrapper.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
Reviewed-by: John Hubbard
---
include/linux/ioport.h | 2 ++
kernel/resource.c
This function has never been used since it was first added to the kernel
more than a year and a half ago, and if we ever grow a consumer of the
MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages
directly.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
: Christoph Hellwig
---
drivers/dax/device.c | 1 +
include/linux/memremap.h | 8
kernel/memremap.c| 22 ++
3 files changed, 31 insertions(+)
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index 8465d12fecba..79014baa782d 100644
--- a/drivers/dax
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
Reviewed-by: Jason Gunthorpe
Acked-by: Michal Hocko
---
include/linux/hmm.h | 4 ++--
include/linux/ioport.h | 1 -
include/linux/memre
This replaces the hacky ->fault callback, which is currently directly
called from common code through a hmm specific data structure as an
exercise in layering violations.
Signed-off-by: Christoph Hellwig
Reviewed-by: Ralph Campbell
---
include/linux/hmm.h | 6 --
include/li
Passing the actual typed structure leads to more understandable code
vs just passing the ref member.
Reported-by: Logan Gunthorpe
Signed-off-by: Christoph Hellwig
Reviewed-by: Logan Gunthorpe
Reviewed-by: Jason Gunthorpe
Reviewed-by: Dan Williams
---
drivers/dax/device.c | 12
nouveau is currently using this through an odd hmm wrapper, and I plan
to switch it to the real thing later in this series.
Signed-off-by: Christoph Hellwig
Reviewed-by: John Hubbard
---
mm/mempolicy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index
Hi Dan, Jérôme and Jason,
below is a series that cleans up the dev_pagemap interface so that
it is more easily usable, which removes the need to wrap it in hmm
and thus allowing to kill a lot of code
Note: this series is on top of Linux 5.2-rc5 and has some minor
conflicts with the hmm tree that
Add a flags field to struct dev_pagemap to replace the altmap_valid
boolean to be a little more extensible. Also add a pgmap_altmap() helper
to find the optional altmap and clean up the code using the altmap using
it.
Signed-off-by: Christoph Hellwig
---
arch/powerpc/mm/mem.c | 10
struct dev_pagemap is always embedded into a containing structure, so
there is no need to an additional private data field.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/nvdimm/pmem.c| 2 +-
include/linux/memremap.h | 3 +--
kernel/memremap.c| 2 +-
mm
This code is a trivial wrapper around device model helpers, which
should have been integrated into the driver device model usage from
the start. Assuming it actually had users, which it never had since
the code was added more than 1 1/2 years ago.
Signed-off-by: Christoph Hellwig
Reviewed-by
Just use devm_memremap_pages instead of hmm_devmem_add pages to allow
killing that wrapper which doesn't provide a whole lot of benefits.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 82 --
1 file changed, 38 insertions(+), 44 dele
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau
depend on it instead of the mix of a dummy dependency symbol plus the
actually selected one. Drop various odd dependencies, as the code is
pretty portable.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau
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 | 43 ---
2 files changed, 47 deletions(-)
diff --git a/drivers/dax/dax
Remove the clumsy hmm_devmem_page_{get,set}_drvdata helpers, and
instead just access the page directly. Also make the page data
a void pointer, and thus much easier to use.
Signed-off-by: Christoph Hellwig
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 18 ++-
include/linux/hmm.h
The only user of it has just been removed, and there wasn't really any need
to wrap a basic memory allocator to start with.
Signed-off-by: Christoph Hellwig
---
include/linux/hmm.h | 3 ---
mm/hmm.c| 14 --
2 files changed, 17 deletions(-)
diff --git a/include/
The functionality is identical to the one currently open coded in
p2pdma.c.
Signed-off-by: Christoph Hellwig
---
drivers/pci/p2pdma.c | 57
1 file changed, 4 insertions(+), 53 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
Provide an internal refcounting logic if no ->ref field is provided
in the pagemap passed into devm_memremap_pages so that callers don't
have to reinvent it poorly.
Signed-off-by: Christoph Hellwig
---
include/linux/memremap.h | 4 ++
kernel/memremap.c
There isn't really much value add in the hmm_devmem_add wrapper and
more, as using devm_memremap_pages directly now is just as simple.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
Documentation/vm/hmm.rst | 26
include/linux/hmm.h
The migrate_vma helper is only used by noveau to migrate device private
pages around. Other HMM_MIRROR users like amdgpu or infiniband don't
need it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/gpu/drm/nouveau/Kconfig | 1 +
mm/Kconfig
hmm_vma_alloc_locked_page is scheduled to go away, use the proper
mm function directly.
Signed-off-by: Christoph Hellwig
Reviewed-by: Jason Gunthorpe
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau
The ZONE_DEVICE support doesn't depend on anything HMM related, just on
various bits of arch support as indicated by the architecture. Also
don't select the option from nouveau as it isn't present in many setups,
and depend on it instead.
Signed-off-by: Christoph Hellwig
---
On Wed, Jun 26, 2019 at 12:04:46PM -0700, Ira Weiny wrote:
> > +static int devmap_managed_enable_get(struct device *dev, struct
> > dev_pagemap *pgmap)
> > +{
> > + if (!pgmap->ops->page_free) {
>
> NIT: later on you add the check for pgmap->ops... it should probably be here.
>
> But not sure
On Wed, Jun 26, 2019 at 02:47:50PM -0700, Ira Weiny wrote:
> > +
> > + init_completion(&pgmap->done);
> > + error = percpu_ref_init(&pgmap->internal_ref,
> > + dev_pagemap_percpu_release, 0, GFP_KERNEL);
> > + if (error)
> > +
On Thu, Jun 27, 2019 at 04:29:45PM +, Jason Gunthorpe wrote:
> I'ver heard there are some other use models for fault() here beyond
> migrate to ram, but we can rename it if we ever see them.
Well, it absolutely needs to migrate to some piece of addressable
and coherent memory, so ram might be
On Thu, Jun 27, 2019 at 04:18:22PM +, Jason Gunthorpe wrote:
> On Wed, Jun 26, 2019 at 02:27:02PM +0200, Christoph Hellwig wrote:
> > This function has never been used since it was first added to the kernel
> > more than a year and a half ago, and if we ever grow a
On Fri, Jun 28, 2019 at 11:44:35AM -0700, Dan Williams wrote:
> There is a problem with the series in CH's tree. It removes the
> ->page_free() callback from the release_pages() path because it goes
> too far and removes the put_devmap_managed_page() call.
release_pages only called put_devmap_mana
On Fri, Jun 28, 2019 at 11:59:19AM -0700, Dan Williams wrote:
> It's a bug that the call to put_devmap_managed_page() was gated by
> MEMORY_DEVICE_PUBLIC in release_pages(). That path is also applicable
> to MEMORY_DEVICE_FSDAX because it needs to trigger the ->page_free()
> callback to wake up wai
the hmm_hmm_destroy().
Signed-off-by: Jason Gunthorpe
Reviewed-by: Jérôme Glisse
Reviewed-by: John Hubbard
Reviewed-by: Ralph Campbell
Reviewed-by: Ira Weiny
Reviewed-by: Christoph Hellwig
Tested-by: Philip Yang
---
include/linux/hmm.h | 3 ---
kernel/fork.c | 1 -
mm/hm
From: "Kuehling, Felix"
Don't set this flag by default in hmm_vma_do_fault. It is set
conditionally just a few lines below. Setting it unconditionally can lead
to handle_mm_fault doing a non-blocking fault, returning -EBUSY and
unlocking mmap_sem unexpectedly.
Signed-off-by: Felix Kuehling
Revi
be valid as part of a registered mirror so all we
need in hmm_register_range() is a simple kref_get.
Suggested-by: Ralph Campbell
Signed-off-by: Jason Gunthorpe
Reviewed-by: John Hubbard
Reviewed-by: Ralph Campbell
Reviewed-by: Ira Weiny
Reviewed-by: Christoph Hellwig
Tested-by: Philip Yang
-by: Ira Weiny
Reviewed-by: Christoph Hellwig
Tested-by: Philip Yang
---
mm/hmm.c | 77 ++--
1 file changed, 30 insertions(+), 47 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index 080b17a2e87e..0423f4ca3a7e 100644
--- a/mm/hmm.c
+++ b/mm/hm
201 - 300 of 519 matches
Mail list logo