From: KAMEZAWA Hiroyuki Date: Tue, 16 Oct 2007 08:26:13 +0000 (-0700) Subject: memory unplug: ia64 interface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de33b821f34dc9e2fabf81a8ba464f3ef039bd00;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git memory unplug: ia64 interface IA64 memory unplug interface. Signed-off-by: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index a096b30734f3..947ec0c73234 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -721,7 +721,17 @@ int arch_add_memory(int nid, u64 start, u64 size) int remove_memory(u64 start, u64 size) { - return -EINVAL; + unsigned long start_pfn, end_pfn; + unsigned long timeout = 120 * HZ; + int ret; + start_pfn = start >> PAGE_SHIFT; + end_pfn = start_pfn + (size >> PAGE_SHIFT); + ret = offline_pages(start_pfn, end_pfn, timeout); + if (ret) + goto out; + /* we can free mem_map at this point */ +out: + return ret; } EXPORT_SYMBOL_GPL(remove_memory); #endif