aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 3b676b0c5c3e..c38778610aa8 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1679,9 +1679,21 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
1679 page_xchg_last_nid(new_page, page_last_nid(page)); 1679 page_xchg_last_nid(new_page, page_last_nid(page));
1680 1680
1681 isolated = numamigrate_isolate_page(pgdat, page); 1681 isolated = numamigrate_isolate_page(pgdat, page);
1682 if (!isolated) { 1682
1683 /*
1684 * Failing to isolate or a GUP pin prevents migration. The expected
1685 * page count is 2. 1 for anonymous pages without a mapping and 1
1686 * for the callers pin. If the page was isolated, the page will
1687 * need to be put back on the LRU.
1688 */
1689 if (!isolated || page_count(page) != 2) {
1683 count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR); 1690 count_vm_events(PGMIGRATE_FAIL, HPAGE_PMD_NR);
1684 put_page(new_page); 1691 put_page(new_page);
1692 if (isolated) {
1693 putback_lru_page(page);
1694 isolated = 0;
1695 goto out;
1696 }
1685 goto out_keep_locked; 1697 goto out_keep_locked;
1686 } 1698 }
1687 1699