memory-hotplug: introduce new arch_remove_memory() for removing page table
[deliverable/linux.git] / arch / powerpc / mm / mem.c
index 0dba5066c22ac4f59578c3663c212f8a07ca3a78..09c64518b4d0b55d9eabc3df40fc197a7202949c 100644 (file)
@@ -133,6 +133,18 @@ int arch_add_memory(int nid, u64 start, u64 size)
 
        return __add_pages(nid, zone, start_pfn, nr_pages);
 }
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+int arch_remove_memory(u64 start, u64 size)
+{
+       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long nr_pages = size >> PAGE_SHIFT;
+       struct zone *zone;
+
+       zone = page_zone(pfn_to_page(start_pfn));
+       return __remove_pages(zone, start_pfn, nr_pages);
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 /*
This page took 0.024107 seconds and 5 git commands to generate.