diff options
author | Christoph Hellwig <hch@lst.de> | 2017-12-29 08:53:55 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2018-01-08 11:46:23 -0800 |
commit | da024512a1fa5c979257e442130ee1d468285057 (patch) | |
tree | 5cad09e1c6c715648c61a352b94b80c47e6d5beb /arch/powerpc | |
parent | 7b73d978a5d0d2a3637bdd57191cb6ffbad3feca (diff) | |
download | linux-da024512a1fa5c979257e442130ee1d468285057.tar.gz linux-da024512a1fa5c979257e442130ee1d468285057.tar.bz2 linux-da024512a1fa5c979257e442130ee1d468285057.zip |
mm: pass the vmem_altmap to arch_remove_memory and __remove_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 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/mem.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index e670cfc2766e..22aa528b78a2 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -149,11 +149,10 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, } #ifdef CONFIG_MEMORY_HOTREMOVE -int arch_remove_memory(u64 start, u64 size) +int arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) { unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT; - struct vmem_altmap *altmap; struct page *page; int ret; @@ -162,11 +161,10 @@ int arch_remove_memory(u64 start, u64 size) * when querying the zone. */ page = pfn_to_page(start_pfn); - altmap = to_vmem_altmap((unsigned long) page); if (altmap) page += vmem_altmap_offset(altmap); - ret = __remove_pages(page_zone(page), start_pfn, nr_pages); + ret = __remove_pages(page_zone(page), start_pfn, nr_pages, altmap); if (ret) return ret; |