The patch titled Subject: mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2 has been added to the -mm mm-unstable branch. Its filename is mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Barry Song <v-songbaohua@xxxxxxxx> Subject: mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2 Date: Sat, 22 Jun 2024 15:14:53 +1200 Link: https://lkml.kernel.org/r/20240622032002.53033-1-21cnbao@xxxxxxxxx Signed-off-by: Barry Song <v-songbaohua@xxxxxxxx> Suggested-by: David Hildenbrand <david@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 1 + mm/swapfile.c | 1 + 2 files changed, 2 insertions(+) --- a/mm/memory.c~mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2 +++ a/mm/memory.c @@ -4346,6 +4346,7 @@ check_folio: * here, we have to be careful. */ VM_WARN_ON_ONCE(folio_test_large(folio)); + VM_WARN_ON_FOLIO(!folio_test_locked(folio), folio); folio_add_new_anon_rmap(folio, vma, address, rmap_flags); } else { folio_add_anon_rmap_ptes(folio, page, nr_pages, vma, address, --- a/mm/swapfile.c~mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2 +++ a/mm/swapfile.c @@ -1923,6 +1923,7 @@ static int unuse_pte(struct vm_area_stru */ if (!folio_test_anon(folio)) { VM_WARN_ON_ONCE(folio_test_large(folio)); + VM_WARN_ON_FOLIO(!folio_test_locked(folio), folio); folio_add_new_anon_rmap(folio, vma, addr, rmap_flags); } else { folio_add_anon_rmap_pte(folio, page, vma, addr, rmap_flags); _ Patches currently in -mm which might be from v-songbaohua@xxxxxxxx are mm-remove-the-implementation-of-swap_free-and-always-use-swap_free_nr.patch mm-introduce-pte_move_swp_offset-helper-which-can-move-offset-bidirectionally.patch mm-introduce-arch_do_swap_page_nr-which-allows-restore-metadata-for-nr-pages.patch mm-swap-reuse-exclusive-folio-directly-instead-of-wp-page-faults.patch mm-introduce-pmdpte_needs_soft_dirty_wp-helpers-for-softdirty-write-protect.patch mm-set-pte-writable-while-pte_soft_dirty-is-true-in-do_swap_page.patch mm-extend-rmap-flags-arguments-for-folio_add_new_anon_rmap.patch mm-extend-rmap-flags-arguments-for-folio_add_new_anon_rmap-fix-2.patch mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false.patch mm-use-folio_add_new_anon_rmap-if-folio_test_anonfolio==false-fix-2.patch mm-remove-folio_test_anonfolio==false-path-in-__folio_add_anon_rmap.patch tools-mm-introduce-a-tool-to-assess-swap-entry-allocation-for-thp_swapout.patch