linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Add remove_memory() for ppc64
@ 2007-10-31 16:49 Badari Pulavarty
  2007-10-31 20:45 ` Dave Hansen
  2007-11-01  6:26 ` Kumar Gala
  0 siblings, 2 replies; 9+ messages in thread
From: Badari Pulavarty @ 2007-10-31 16:49 UTC (permalink / raw)
  To: Paul Mackerras, Andrew Morton
  Cc: linuxppc-dev, anton, KAMEZAWA Hiroyuki, linux-mm

Supply arch specific remove_memory() for PPC64. There is nothing
ppc specific code here and its exactly same as ia64 version. 
For now, lets keep it arch specific - so each arch can add
its own special things if needed.

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

Index: linux-2.6.23/arch/powerpc/mm/mem.c
===================================================================
--- linux-2.6.23.orig/arch/powerpc/mm/mem.c	2007-10-25 11:34:54.000000000 -0700
+++ linux-2.6.23/arch/powerpc/mm/mem.c	2007-10-25 11:35:24.000000000 -0700
@@ -131,6 +131,20 @@ int __devinit arch_add_memory(int nid, u
 
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int remove_memory(u64 start, u64 size)
+{
+	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);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(remove_memory);
+#endif /* CONFIG_MEMORY_HOTREMOVE */
+
 void show_mem(void)
 {
 	unsigned long total = 0, reserved = 0;

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

end of thread, other threads:[~2007-11-01  0:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 16:49 [PATCH 1/3] Add remove_memory() for ppc64 Badari Pulavarty
2007-10-31 20:45 ` Dave Hansen
2007-10-31 22:11   ` Badari Pulavarty
2007-10-31 21:55     ` Dave Hansen
2007-11-01  0:46       ` KAMEZAWA Hiroyuki
2007-10-31 22:13   ` Badari Pulavarty
2007-11-01  6:26 ` Kumar Gala
2007-10-31 21:45   ` Badari Pulavarty
2007-10-31 21:47     ` Dale Farnsworth

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