search for: devm_memremap_pages_release

Displaying 9 results from an estimated 9 matches for "devm_memremap_pages_release".

2019 Jun 26
0
[PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap
..._kill(pgmap->ref); +} + +static void dev_pagemap_cleanup(struct dev_pagemap *pgmap) +{ + if (pgmap->ops && pgmap->ops->cleanup) { + pgmap->ops->cleanup(pgmap); + } else { + wait_for_completion(&pgmap->done); + percpu_ref_exit(pgmap->ref); + } +} + static void devm_memremap_pages_release(void *data) { struct dev_pagemap *pgmap = data; @@ -84,10 +102,10 @@ static void devm_memremap_pages_release(void *data) unsigned long pfn; int nid; - pgmap->ops->kill(pgmap); + dev_pagemap_kill(pgmap); for_each_device_pfn(pfn, pgmap) put_page(pfn_to_page(pfn)); - pgmap->ops-...
2019 Jun 26
1
[PATCH 15/25] memremap: provide an optional internal refcount in struct dev_pagemap
...p_cleanup(struct dev_pagemap *pgmap) > +{ > + if (pgmap->ops && pgmap->ops->cleanup) { > + pgmap->ops->cleanup(pgmap); > + } else { > + wait_for_completion(&pgmap->done); > + percpu_ref_exit(pgmap->ref); > + } > +} > + > static void devm_memremap_pages_release(void *data) > { > struct dev_pagemap *pgmap = data; > @@ -84,10 +102,10 @@ static void devm_memremap_pages_release(void *data) > unsigned long pfn; > int nid; > > - pgmap->ops->kill(pgmap); > + dev_pagemap_kill(pgmap); > for_each_device_pfn(pfn, pgmap) &g...
2019 Jun 26
0
[PATCH 14/25] memremap: replace the altmap_valid field with a PGMAP_ALTMAP_VALID flag
...start >> PAGE_SHIFT; - if (pgmap->altmap_valid) - pfn += vmem_altmap_offset(altmap); - return pfn; + return (pgmap->res.start >> PAGE_SHIFT) + + vmem_altmap_offset(pgmap_altmap(pgmap)); } static unsigned long pfn_end(struct dev_pagemap *pgmap) @@ -109,7 +103,7 @@ static void devm_memremap_pages_release(void *data) align_size >> PAGE_SHIFT, NULL); } else { arch_remove_memory(nid, align_start, align_size, - pgmap->altmap_valid ? &pgmap->altmap : NULL); + pgmap_altmap(pgmap)); kasan_remove_zero_shadow(__va(align_start), align_size); } mem_hotplug_done(); @@ -12...
2019 Jun 13
0
[PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure
...*data; enum memory_type type; u64 pci_p2pdma_bus_offset; + const struct dev_pagemap_ops *ops; }; #ifdef CONFIG_ZONE_DEVICE diff --git a/kernel/memremap.c b/kernel/memremap.c index 1490e63f69a9..e23286ce0ec4 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -92,7 +92,7 @@ static void devm_memremap_pages_release(void *data) unsigned long pfn; int nid; - pgmap->kill(pgmap->ref); + pgmap->ops->kill(pgmap->ref); for_each_device_pfn(pfn, pgmap) put_page(pfn_to_page(pfn)); @@ -127,8 +127,8 @@ static void devm_memremap_pages_release(void *data) * @pgmap: pointer to a struct dev_page...
2019 Jun 26
41
dev_pagemap related cleanups v3
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 are easy to resolve. Diffstat summary: 32 files changed, 361 insertions(+), 1012 deletions(-) Git
2019 Jun 17
0
[PATCH 08/25] memremap: move dev_pagemap callbacks into a separate structure
...ata; enum memory_type type; u64 pci_p2pdma_bus_offset; + const struct dev_pagemap_ops *ops; }; #ifdef CONFIG_ZONE_DEVICE diff --git a/kernel/memremap.c b/kernel/memremap.c index 6a2dd31a6250..85635ff57e04 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -92,10 +92,10 @@ static void devm_memremap_pages_release(void *data) unsigned long pfn; int nid; - pgmap->kill(pgmap->ref); + pgmap->ops->kill(pgmap->ref); for_each_device_pfn(pfn, pgmap) put_page(pfn_to_page(pfn)); - pgmap->cleanup(pgmap->ref); + pgmap->ops->cleanup(pgmap->ref); /* pages are dead and unused,...
2019 Jun 17
34
dev_pagemap related cleanups v2
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 that went into 5.2-rc5. Git tree: git://git.infradead.org/users/hch/misc.git
2019 Jun 13
0
[PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill
...dev_pagemap to the dead state. */ - void (*kill)(struct percpu_ref *ref); + void (*kill)(struct dev_pagemap *pgmap); }; /** diff --git a/kernel/memremap.c b/kernel/memremap.c index e23286ce0ec4..94b830b6eca5 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -92,7 +92,7 @@ static void devm_memremap_pages_release(void *data) unsigned long pfn; int nid; - pgmap->ops->kill(pgmap->ref); + pgmap->ops->kill(pgmap); for_each_device_pfn(pfn, pgmap) put_page(pfn_to_page(pfn)); @@ -266,7 +266,7 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap) err_pfn_remap:...
2019 Jun 13
57
dev_pagemap related cleanups
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 Diffstat: 22 files changed, 245 insertions(+), 802 deletions(-) Git tree: git://git.infradead.org/users/hch/misc.git hmm-devmem-cleanup Gitweb: