Skip to content

Commit 0a2e280

Browse files
kiryltorvalds
authored andcommitted
mm, thp: fix migration of PTE-mapped transparent huge pages
We don't have native support of THP migration, so we have to split huge page into small pages in order to migrate it to different node. This includes PTE-mapped huge pages. I made mistake in refcounting patchset: we don't actually split PTE-mapped huge page in queue_pages_pte_range(), if we step on head page. The result is that the head page is queued for migration, but none of tail pages: putting head page on queue takes pin on the page and any subsequent attempts of split_huge_pages() would fail and we skip queuing tail pages. unmap_and_move_huge_page() will eventually split the huge pages, but only one of 512 pages would get migrated. Let's fix the situation. Fixes: 248db92 ("migrate_pages: try to split pages on queuing") Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 30f471f commit 0a2e280

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/mempolicy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ static int queue_pages_pte_range(pmd_t *pmd, unsigned long addr,
532532
nid = page_to_nid(page);
533533
if (node_isset(nid, *qp->nmask) == !!(flags & MPOL_MF_INVERT))
534534
continue;
535-
if (PageTail(page) && PageAnon(page)) {
535+
if (PageTransCompound(page) && PageAnon(page)) {
536536
get_page(page);
537537
pte_unmap_unlock(pte, ptl);
538538
lock_page(page);

0 commit comments

Comments
 (0)