summaryrefslogtreecommitdiffstats
path: root/kernel/memremap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-12-29 08:53:53 +0100
committerDan Williams <dan.j.williams@intel.com>2018-01-08 11:46:23 -0800
commit24e6d5a59ac7d31adc0322de2d0117dfa370936f (patch)
treeb021d2de9c55ffda9054b36e8d76487c1c06f876 /kernel/memremap.c
parent55ce6e23ebd159bc3d8f0a20e27503e09b5d8138 (diff)
downloadlinux-24e6d5a59ac7d31adc0322de2d0117dfa370936f.tar.gz
linux-24e6d5a59ac7d31adc0322de2d0117dfa370936f.tar.bz2
linux-24e6d5a59ac7d31adc0322de2d0117dfa370936f.zip
mm: pass the vmem_altmap to arch_add_memory and __add_pages
We can just pass this on instead of having to do a radix tree lookup without proper locking 2 levels into the callchain. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'kernel/memremap.c')
-rw-r--r--kernel/memremap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 403ab9cdb949..8488cdeead16 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -382,6 +382,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
if (altmap) {
memcpy(&page_map->altmap, altmap, sizeof(*altmap));
pgmap->altmap = &page_map->altmap;
+ altmap = pgmap->altmap;
}
pgmap->ref = ref;
pgmap->res = &page_map->res;
@@ -427,7 +428,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
goto err_pfn_remap;
mem_hotplug_begin();
- error = arch_add_memory(nid, align_start, align_size, false);
+ error = arch_add_memory(nid, align_start, align_size, altmap, false);
if (!error)
move_pfn_range_to_zone(&NODE_DATA(nid)->node_zones[ZONE_DEVICE],
align_start >> PAGE_SHIFT,