linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [-mm PATCH] updates for hotplug memory remove
@ 2008-01-29  0:31 Badari Pulavarty
  2008-01-29  0:35 ` Badari Pulavarty
  0 siblings, 1 reply; 5+ messages in thread
From: Badari Pulavarty @ 2008-01-29  0:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linuxppc-dev, pbadari

Hi Andrew,

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).

memory-hotplug-add-removable-to-sysfs-to-show-memblock-removability.patch

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 ?

add-remove_memory-for-ppc64-2.patch

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.

Thanks,
Badari

Supply ppc64 remove_memory() function. Arch specific is still
being reviewed by Paul Mackerras.

From: Badari Pulavarty <pbadari@us.ibm.com>
---
 arch/powerpc/mm/mem.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Index: linux-2.6.24-rc8/arch/powerpc/mm/mem.c
===================================================================
--- 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);
 }
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
+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 */
+out:
+	return ret;
+}
+#endif /* CONFIG_MEMORY_HOTREMOVE */
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 void show_mem(void)


--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-30  1:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29  0:31 [-mm PATCH] updates for hotplug memory remove Badari Pulavarty
2008-01-29  0:35 ` Badari Pulavarty
2008-01-29  5:18   ` Yasunori Goto
2008-01-30  0:31     ` Badari Pulavarty
2008-01-30  1:13       ` Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).