search for: memremap

Displaying 20 results from an estimated 82 matches for "memremap".

2019 Jun 26
0
[PATCH 08/25] memremap: validate the pagemap type passed to devm_memremap_pages
...or a type that is valid for the current configuration before setting up the pagemap. For this the usage of the 0 type for device dax gets replaced with an explicit MEMORY_DEVICE_DEVDAX type. Signed-off-by: Christoph Hellwig <hch at lst.de> --- 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/device.c +++ b/drivers/dax/device.c @@ -468,6 +468,7 @@ int dev_dax_probe(stru...
2020 Mar 16
0
[PATCH 1/4] memremap: add an owner field to struct dev_pagemap
...e hmm and migrate_vma code to identify who owns ZONE_DEVICE memory, and refuse to work on mappings not owned by the calling entity. Signed-off-by: Christoph Hellwig <hch at lst.de> --- arch/powerpc/kvm/book3s_hv_uvmem.c | 2 ++ drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 + include/linux/memremap.h | 4 ++++ mm/memremap.c | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c index 79b1202b1c62..67fefb03b9b7 100644 --- a/arch/powerpc/kvm/book3s_hv_uvmem.c +++ b/arch/powerpc/kvm/...
2019 Jun 13
0
[PATCH 11/22] memremap: remove the data field in struct dev_pagemap
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 <hch at lst.de> --- drivers/nvdimm/pmem.c | 2 +- include/linux/memremap.h | 3 +-- kernel/memremap.c | 2 +- mm/hmm.c | 9 +++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 66837eed6375..847d1b2bc10e 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -334,7...
2019 Jun 13
0
[PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill
...he actual typed structure leads to more understandable code vs the actual references. Signed-off-by: Christoph Hellwig <hch at lst.de> --- drivers/dax/device.c | 7 +++---- drivers/nvdimm/pmem.c | 6 +++--- drivers/pci/p2pdma.c | 6 +++--- include/linux/memremap.h | 2 +- kernel/memremap.c | 4 ++-- mm/hmm.c | 4 ++-- tools/testing/nvdimm/test/iomap.c | 6 ++---- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/dax/device.c b/drivers/dax/device.c index 4adab774dade..e23fa1bd8c97 1006...
2019 Jun 13
0
[PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops
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 <hch at lst.de> --- include/linux/hmm.h | 6 ------ include/linux/memremap.h | 6 ++++++ include/linux/swapops.h | 15 --------------- kernel/memremap.c | 31 ------------------------------- mm/hmm.c | 13 +++++-------- mm/memory.c | 9 ++------- 6 files changed, 13 insertions(+), 67 deletions(-) diff --git a/include/linux/hmm.h b/i...
2019 Jun 26
0
[PATCH 12/25] memremap: add a migrate_to_ram method to struct dev_pagemap_ops
...ich is currently directly called from common code through a hmm specific data structure as an exercise in layering violations. Signed-off-by: Christoph Hellwig <hch at lst.de> Reviewed-by: Ralph Campbell <rcampbell at nvidia.com> --- include/linux/hmm.h | 6 ------ include/linux/memremap.h | 6 ++++++ include/linux/swapops.h | 15 --------------- kernel/memremap.c | 35 ++++------------------------------- mm/hmm.c | 13 +++++-------- mm/memory.c | 9 ++------- 6 files changed, 17 insertions(+), 67 deletions(-) diff --git a/include/linux/hmm.h...
2019 Jun 13
1
[PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops
...->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 <hch at lst.de> > --- > include/linux/hmm.h | 6 ------ > include/linux/memremap.h | 6 ++++++ > include/linux/swapops.h | 15 --------------- > kernel/memremap.c | 31 ------------------------------- > mm/hmm.c | 13 +++++-------- > mm/memory.c | 9 ++------- > 6 files changed, 13 insertions(+), 67 deletions(-) > &...
2019 Jun 17
2
[PATCH 07/25] memremap: validate the pagemap type passed to devm_memremap_pages
...h at lst.de> wrote: > > 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 <hch at lst.de> > --- > kernel/memremap.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/kernel/memremap.c b/kernel/memremap.c > index 6e1970719dc2..6a2dd31a6250 100644 > --- a/kernel/memremap.c > +++ b/kernel/memremap.c > @@ -157,6 +157,33 @@ void *devm_memremap_pages(struct de...
2019 Jun 26
0
[PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap
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 <hch at lst.de> --- include/linux/memremap.h | 4 ++ kernel/memremap.c | 64 ++++++++++++++++++++++++------- tools/testing/nvdimm/test/iomap.c | 58 ++++++++++++++++++++++--...
2019 Jun 17
0
[PATCH 07/25] memremap: validate the pagemap type passed to devm_memremap_pages
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 <hch at lst.de> --- kernel/memremap.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/kernel/memremap.c b/kernel/memremap.c index 6e1970719dc2..6a2dd31a6250 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -157,6 +157,33 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgm...
2019 Jun 26
1
[PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap
On Wed, Jun 26, 2019 at 02:27:14PM +0200, Christoph Hellwig wrote: > 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 <hch at lst.de> > --- > include/linux/memremap.h | 4 ++ > kernel/memremap.c | 64 ++++++++++++++++++++++++------- > tools/testing/nvdimm/test/io...
2019 Jun 13
0
[PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure
...for multiple instances, and an attacker can't easily overwrite them. Signed-off-by: Christoph Hellwig <hch at lst.de> --- drivers/dax/device.c | 6 +++++- drivers/nvdimm/pmem.c | 18 +++++++++++++----- drivers/pci/p2pdma.c | 5 ++++- include/linux/memremap.h | 29 +++++++++++++++-------------- kernel/memremap.c | 12 ++++++------ mm/hmm.c | 8 ++++++-- tools/testing/nvdimm/test/iomap.c | 2 +- 7 files changed, 50 insertions(+), 30 deletions(-) diff --git a/drivers/dax/device.c b/drivers/dax/device....
2019 Jun 26
0
[PATCH 14/25] memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag
...d the optional altmap and clean up the code using the altmap using it. Signed-off-by: Christoph Hellwig <hch at lst.de> --- 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 | 12 +++++++++++- kernel/memremap.c | 26 ++++++++++---------------- mm/hmm.c | 1 - mm/memory_hotplug.c | 6 ++---- mm/page_alloc.c | 5 ++--- 9 files changed, 29 insertions(+), 43 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/me...
2020 Sep 14
5
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...that ZONE_DEVICE struct page reference counting is ugly/broken. This is my attempt to fix it and it works for the HMM migration self tests. I'm only sending this out as a RFC since I'm not that familiar with the DAX, PMEM, XEN, and other uses of ZONE_DEVICE struct pages allocated with devm_memremap_pages() or memremap_pages() but my best reading of the code looks like it might be OK. I could use help testing these configurations. I have a modified THP migration patch series that applies on top of this one and is cleaner since I don't have to add code to handle the +1 reference count. The...
2019 Jun 13
0
[PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages
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 <hch at lst.de> --- drivers/nvdimm/pmem.c | 23 +++-------------- include/linux/mm.h | 10 -------- kernel/memremap.c | 59 +++++++++++++++++++++++++++---------------- mm/hmm.c | 2 -- 4 files changed, 41 insertions(+), 53 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index b9638c6553a1..66837eed6375 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -3...
2019 Jun 17
0
[PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
...ang at deltatee.com> Reviewed-by: Jason Gunthorpe <jgg at mellanox.com> --- drivers/dax/device.c | 11 ++++++---- drivers/dax/pmem/core.c | 2 +- drivers/nvdimm/pmem.c | 19 +++++++++------- drivers/pci/p2pdma.c | 9 +++++--- include/linux/memremap.h | 36 +++++++++++++++++-------------- kernel/memremap.c | 18 ++++++++-------- mm/hmm.c | 10 ++++++--- tools/testing/nvdimm/test/iomap.c | 9 ++++---- 8 files changed, 65 insertions(+), 49 deletions(-) diff --git a/drivers/dax/device.c b/driver...
2019 Jun 17
0
[PATCH 10/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages
...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 <hch at lst.de> --- drivers/nvdimm/pmem.c | 23 +++-------------- include/linux/mm.h | 10 -------- kernel/memremap.c | 57 ++++++++++++++++++++++++++----------------- mm/hmm.c | 2 -- 4 files changed, 39 insertions(+), 53 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 469a0f5b3380..85364c59c607 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -3...
2020 Sep 26
1
[PATCH 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...be treated specially for ZONE_DEVICE. > > Signed-off-by: Ralph Campbell <rcampbell at nvidia.com> > --- > arch/powerpc/kvm/book3s_hv_uvmem.c | 2 +- > drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- > include/linux/dax.h | 2 +- > include/linux/memremap.h | 7 ++- > include/linux/mm.h | 44 -------------- > lib/test_hmm.c | 2 +- > mm/gup.c | 44 -------------- > mm/internal.h | 8 +++ > mm/memremap.c...
2019 Jun 26
0
[PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages
...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 <hch at lst.de> --- drivers/nvdimm/pmem.c | 23 +++-------------- include/linux/mm.h | 10 -------- kernel/memremap.c | 59 +++++++++++++++++++++++++++---------------- mm/hmm.c | 2 -- 4 files changed, 41 insertions(+), 53 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 9dac48359353..48767171a4df 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -3...
2019 Jun 26
1
[PATCH 11/25] memremap: lift the devmap_enable manipulation into devm_memremap_pages
...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 <hch at lst.de> > --- > drivers/nvdimm/pmem.c | 23 +++-------------- > include/linux/mm.h | 10 -------- > kernel/memremap.c | 59 +++++++++++++++++++++++++++---------------- > mm/hmm.c | 2 -- > 4 files changed, 41 insertions(+), 53 deletions(-) > > diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c > index 9dac48359353..48767171a4df 100644 > --- a/drivers/nvdimm/pmem.c &gt...