arm64: Fix compilation errors while enabling memory hotplug
Fix compilation errors ecountered while enabling memory hotplug caused by function prototype changes in 'commit24e6d5a59a("mm: pass the vmem_altmap to arch_add_memory and __add_pages")' 'commitda024512a1("mm: pass the vmem_altmap to arch_remove_memory and __remove_pages")' 'commit24b6d41643("mm: pass the vmem_altmap to vmemmap_free")'. The errors were caused since the prototype changes in functions vmemmap_free arch_remove_memory and arch_add_memory were not propagated to the arm64 version. Change-Id: I9933ab14d6483f8a6c8ddc7fe9b414149e9df3b7 Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
This commit is contained in:
committed by
Patrick Daly
parent
11ec78dc81
commit
025a7467ee
@@ -785,7 +785,8 @@ static int __init register_mem_limit_dumper(void)
|
|||||||
__initcall(register_mem_limit_dumper);
|
__initcall(register_mem_limit_dumper);
|
||||||
|
|
||||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||||
int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)
|
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
|
||||||
|
bool want_memblock)
|
||||||
{
|
{
|
||||||
pg_data_t *pgdat;
|
pg_data_t *pgdat;
|
||||||
unsigned long start_pfn = start >> PAGE_SHIFT;
|
unsigned long start_pfn = start >> PAGE_SHIFT;
|
||||||
@@ -833,7 +834,7 @@ int arch_add_memory(int nid, u64 start, u64 size, bool want_memblock)
|
|||||||
|
|
||||||
pgdat = NODE_DATA(nid);
|
pgdat = NODE_DATA(nid);
|
||||||
|
|
||||||
ret = __add_pages(nid, start_pfn, nr_pages, want_memblock);
|
ret = __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make the pages usable after they have been added.
|
* Make the pages usable after they have been added.
|
||||||
@@ -874,7 +875,7 @@ static void kernel_physical_mapping_remove(unsigned long start,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 start_pfn = start >> PAGE_SHIFT;
|
||||||
unsigned long nr_pages = size >> PAGE_SHIFT;
|
unsigned long nr_pages = size >> PAGE_SHIFT;
|
||||||
@@ -883,7 +884,7 @@ int arch_remove_memory(u64 start, u64 size)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
zone = page_zone(page);
|
zone = page_zone(page);
|
||||||
ret = __remove_pages(zone, start_pfn, nr_pages);
|
ret = __remove_pages(zone, start_pfn, nr_pages, altmap);
|
||||||
WARN_ON_ONCE(ret);
|
WARN_ON_ONCE(ret);
|
||||||
|
|
||||||
kernel_physical_mapping_remove(start, start + size);
|
kernel_physical_mapping_remove(start, start + size);
|
||||||
|
|||||||
@@ -1165,7 +1165,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
|
|||||||
p = vmemmap_alloc_block_buf(PMD_SIZE, node);
|
p = vmemmap_alloc_block_buf(PMD_SIZE, node);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||||
vmemmap_free(start, end);
|
vmemmap_free(start, end, altmap);
|
||||||
#endif
|
#endif
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -498,12 +498,12 @@ static ssize_t allocated_bytes_show(struct device *dev,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(phys_index, 0444, phys_index_show, NULL);
|
static DEVICE_ATTR(phys_index, 0444, phys_index_show, NULL);
|
||||||
static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state);
|
static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state);
|
||||||
static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL);
|
static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL);
|
||||||
static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL);
|
static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL);
|
||||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||||
static DEVICE_ATTR_RO(allocated_bytes, 0444, allocated_bytes_show, NULL);
|
static DEVICE_ATTR(allocated_bytes, 0444, allocated_bytes_show, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user