]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/sh/mm/init.c
memory-hotplug: introduce new arch_remove_memory() for removing page table
[mirror_ubuntu-zesty-kernel.git] / arch / sh / mm / init.c
index 82cc576fab1572e62d2b48e20f3a972618d06dae..105794037143ee8f2c4b15748c6febd19c543ad9 100644 (file)
@@ -558,4 +558,21 @@ int memory_add_physaddr_to_nid(u64 addr)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
+#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;
+       int ret;
+
+       zone = page_zone(pfn_to_page(start_pfn));
+       ret = __remove_pages(zone, start_pfn, nr_pages);
+       if (unlikely(ret))
+               pr_warn("%s: Failed, __remove_pages() == %d\n", __func__,
+                       ret);
+
+       return ret;
+}
+#endif
 #endif /* CONFIG_MEMORY_HOTPLUG */