|
|
@@ -35,6 +35,7 @@
|
|
|
#include <linux/memblock.h>
|
|
|
#include <linux/bootmem.h>
|
|
|
#include <linux/compaction.h>
|
|
|
+#include <linux/rmap.h>
|
|
|
|
|
|
#include <asm/tlbflush.h>
|
|
|
|
|
|
@@ -1393,6 +1394,21 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
|
|
|
pfn = page_to_pfn(compound_head(page))
|
|
|
+ hpage_nr_pages(page) - 1;
|
|
|
|
|
|
+ /*
|
|
|
+ * HWPoison pages have elevated reference counts so the migration would
|
|
|
+ * fail on them. It also doesn't make any sense to migrate them in the
|
|
|
+ * first place. Still try to unmap such a page in case it is still mapped
|
|
|
+ * (e.g. current hwpoison implementation doesn't unmap KSM pages but keep
|
|
|
+ * the unmap as the catch all safety net).
|
|
|
+ */
|
|
|
+ if (PageHWPoison(page)) {
|
|
|
+ if (WARN_ON(PageLRU(page)))
|
|
|
+ isolate_lru_page(page);
|
|
|
+ if (page_mapped(page))
|
|
|
+ try_to_unmap(page, TTU_IGNORE_MLOCK | TTU_IGNORE_ACCESS);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
if (!get_page_unless_zero(page))
|
|
|
continue;
|
|
|
/*
|