The patch titled Subject: mm/migrate: fix remove_migration_pte() of hugetlb entry has been added to the -mm tree. Its filename is mm-migrate-fix-remove_migration_pte-of-hugetlb-entry.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-migrate-fix-remove_migration_pte-of-hugetlb-entry.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-migrate-fix-remove_migration_pte-of-hugetlb-entry.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Hugh Dickins <hughd@xxxxxxxxxx> Subject: mm/migrate: fix remove_migration_pte() of hugetlb entry The foliation of remove_migration_pte() is currently wrong on hugetlb anon entries, causing LTP move_pages12 to crash on BUG_ON(!PageLocked) in hugepage_add_anon_rmap(). Link: https://lkml.kernel.org/r/bd28ebcf-4d42-7184-8189-ffed6fe7d4dc@xxxxxxxxxx Fixes: b4010e88f071 ("mm/migrate: Convert remove_migration_ptes() to folios") Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/migrate.c~mm-migrate-fix-remove_migration_pte-of-hugetlb-entry +++ a/mm/migrate.c @@ -182,7 +182,8 @@ static bool remove_migration_pte(struct struct page *new; unsigned long idx = 0; - if (!folio_test_ksm(folio)) + /* Skip call in common case, plus .pgoff is invalid for KSM */ + if (pvmw.nr_pages != 1 && !folio_test_hugetlb(folio)) idx = linear_page_index(vma, pvmw.address) - pvmw.pgoff; new = folio_page(folio, idx); _ Patches currently in -mm which might be from hughd@xxxxxxxxxx are memfd-fix-f_seal_write-after-shmem-huge-page-allocated.patch tmpfs-support-for-file-creation-time-fix.patch mm-thp-fix-collapse_files-try_to_unmapfolio.patch mm-migrate-fix-remove_migration_pte-of-hugetlb-entry.patch