]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
memory unplug: ia64 interface
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tue, 16 Oct 2007 08:26:13 +0000 (01:26 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:02 +0000 (09:43 -0700)
IA64 memory unplug interface.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/ia64/mm/init.c

index a096b30734f3dc3db88857fd5889512718ad6c6e..947ec0c73234bcb2dc034ee0df293f38634ce2cb 100644 (file)
@@ -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