aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 89fee2dcb039..c299d083d8e2 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -26,6 +26,7 @@
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/migrate.h> 27#include <linux/migrate.h>
28#include <linux/page-isolation.h> 28#include <linux/page-isolation.h>
29#include <linux/pfn.h>
29 30
30#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
31 32
@@ -849,10 +850,19 @@ failed_removal:
849 850
850 return ret; 851 return ret;
851} 852}
853
854int remove_memory(u64 start, u64 size)
855{
856 unsigned long start_pfn, end_pfn;
857
858 start_pfn = PFN_DOWN(start);
859 end_pfn = start_pfn + PFN_DOWN(size);
860 return offline_pages(start_pfn, end_pfn, 120 * HZ);
861}
852#else 862#else
853int remove_memory(u64 start, u64 size) 863int remove_memory(u64 start, u64 size)
854{ 864{
855 return -EINVAL; 865 return -EINVAL;
856} 866}
857EXPORT_SYMBOL_GPL(remove_memory);
858#endif /* CONFIG_MEMORY_HOTREMOVE */ 867#endif /* CONFIG_MEMORY_HOTREMOVE */
868EXPORT_SYMBOL_GPL(remove_memory);