aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2013-12-18 20:08:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-12-18 22:04:51 -0500
commitde466bd628e8d663fdf3f791bc8db318ee85c714 (patch)
treea7f9cc6ab09cbdbce981b974c8ec238f6c3e1524 /mm/migrate.c
parent1667918b6483b12a6496bf54151b827b8235d7b1 (diff)
mm: numa: avoid unnecessary disruption of NUMA hinting during migration
do_huge_pmd_numa_page() handles the case where there is parallel THP migration. However, by the time it is checked the NUMA hinting information has already been disrupted. This patch adds an earlier check with some helpers. Signed-off-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Alex Thorlton <athorlton@sgi.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index a987525810ae..cfb419085261 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1655,6 +1655,18 @@ int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
1655 return 1; 1655 return 1;
1656} 1656}
1657 1657
1658bool pmd_trans_migrating(pmd_t pmd)
1659{
1660 struct page *page = pmd_page(pmd);
1661 return PageLocked(page);
1662}
1663
1664void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd)
1665{
1666 struct page *page = pmd_page(*pmd);
1667 wait_on_page_locked(page);
1668}
1669
1658/* 1670/*
1659 * Attempt to migrate a misplaced page to the specified destination 1671 * Attempt to migrate a misplaced page to the specified destination
1660 * node. Caller is expected to have an elevated reference count on 1672 * node. Caller is expected to have an elevated reference count on