The patch titled Subject: mm/khugepaged: collapse_pte_mapped_thp() with mmap_read_lock(): fix2 has been added to the -mm mm-unstable branch. Its filename is mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock-fix2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock-fix2.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: Hugh Dickins <hughd@xxxxxxxxxx> Subject: mm/khugepaged: collapse_pte_mapped_thp() with mmap_read_lock(): fix2 Date: Sat, 5 Aug 2023 20:59:27 -0700 (PDT) Use ptep_clear() instead of pte_clear(): when CONFIG_PAGE_TABLE_CHECK=y, ptep_clear() adds some accounting, missing which would cause a BUG later. Link: https://lkml.kernel.org/r/e0197433-8a47-6a65-534d-eda26eeb78b0@xxxxxxxxxx Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> Reported-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx> Closes: https://lore.kernel.org/linux-mm/0df84f9f-e9b0-80b1-4c9e-95abc1a73a96@xxxxxxxxxxxxx/ Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/khugepaged.c~mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock-fix2 +++ a/mm/khugepaged.c @@ -1655,7 +1655,7 @@ int collapse_pte_mapped_thp(struct mm_st * TLB flush can be left until pmdp_collapse_flush() does it. * PTE dirty? Shmem page is already dirty; file is read-only. */ - pte_clear(mm, addr, pte); + ptep_clear(mm, addr, pte); page_remove_rmap(page, vma, false); nr_ptes++; } _ Patches currently in -mm which might be from hughd@xxxxxxxxxx are mm-userfaultfd-add-new-uffdio_poison-ioctl-fix.patch mm-pgtable-add-rcu_read_lock-and-rcu_read_unlocks.patch mm-pgtable-add-pae-safety-to-__pte_offset_map.patch arm-adjust_pte-use-pte_offset_map_nolock.patch powerpc-assert_pte_locked-use-pte_offset_map_nolock.patch powerpc-assert_pte_locked-use-pte_offset_map_nolock-fix.patch powerpc-add-pte_free_defer-for-pgtables-sharing-page.patch sparc-add-pte_free_defer-for-pte_t-pgtable_t.patch s390-add-pte_free_defer-for-pgtables-sharing-page.patch s390-add-pte_free_defer-for-pgtables-sharing-page-fix.patch mm-pgtable-add-pte_free_defer-for-pgtable-as-page.patch mm-khugepaged-retract_page_tables-without-mmap-or-vma-lock.patch mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock.patch mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock-fix.patch mm-khugepaged-collapse_pte_mapped_thp-with-mmap_read_lock-fix2.patch mm-khugepaged-delete-khugepaged_collapse_pte_mapped_thps.patch mm-khugepaged-delete-khugepaged_collapse_pte_mapped_thps-fix.patch mm-delete-mmap_write_trylock-and-vma_try_start_write.patch mm-pgtable-notes-on-pte_offset_map.patch