From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 09 May 2007 12:11:29 +0900 From: Yasunori Goto Subject: [RFC] memory hotremove patch take 2 [06/10] (ia64's remove_memory code) In-Reply-To: <20070509115506.B904.Y-GOTO@jp.fujitsu.com> References: <20070509115506.B904.Y-GOTO@jp.fujitsu.com> Message-Id: <20070509120643.B912.Y-GOTO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Linux Kernel ML , linux-mm Cc: Andrew Morton , Christoph Lameter , Mel Gorman List-ID: Call offline pages from remove_memory(). Signed-off-by: Yasunori Goto Signed-Off-By: KAMEZAWA Hiroyuki arch/ia64/mm/init.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletion(-) Index: current_test/arch/ia64/mm/init.c =================================================================== --- current_test.orig/arch/ia64/mm/init.c 2007-05-08 15:07:20.000000000 +0900 +++ current_test/arch/ia64/mm/init.c 2007-05-08 15:08:07.000000000 +0900 @@ -726,7 +726,18 @@ int arch_add_memory(int nid, u64 start, 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 -- Yasunori Goto -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org