[-mm PATCH] updates for hotplug memory remove
pbadari at us.ibm.com
Tue Jan 29 11:31:22 EST 2008
Here are the updates for hotplug memory remove code currently in -mm.
1) Please don't push this patch to mainline (for the merge window).
I didn't find this consistently useful - even though memory is marked
removable, I found cases where I can't move it. When we get it right,
we can push it at that time. Please leave this in -mm.
2) Can you replace the following patch with this ?
I found that, I do need arch-specific hooks to get the memory remove
working on ppc64 LPAR. Earlier, I tried to make remove_memory() arch
neutral, but we do need arch specific hooks.
Supply ppc64 remove_memory() function. Arch specific is still
being reviewed by Paul Mackerras.
From: Badari Pulavarty <pbadari at us.ibm.com>
arch/powerpc/mm/mem.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- linux-2.6.24-rc8.orig/arch/powerpc/mm/mem.c 2008-01-25 08:04:32.000000000 -0800
+++ linux-2.6.24-rc8/arch/powerpc/mm/mem.c 2008-01-25 08:16:37.000000000 -0800
@@ -145,6 +145,22 @@ walk_memory_resource(unsigned long start
return (*func)(start_pfn, nr_pages, arg);
+int remove_memory(u64 start, u64 size)
+ unsigned long start_pfn, end_pfn;
+ int ret;
+ start_pfn = start >> PAGE_SHIFT;
+ end_pfn = start_pfn + (size >> PAGE_SHIFT);
+ ret = offline_pages(start_pfn, end_pfn, 120 * HZ);
+ if (ret)
+ goto out;
+ /* Arch-specific calls go here - next patch */
+ return ret;
+#endif /* CONFIG_MEMORY_HOTREMOVE */
#endif /* CONFIG_MEMORY_HOTPLUG */
More information about the Linuxppc-dev