The patch titled Date: Thu, 1 Dec 2022 10:19:22 -0500 has been added to the -mm mm-hotfixes-unstable branch. Its filename is mm-migrate-fix-read-only-page-got-writable-when-recover-pte-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-migrate-fix-read-only-page-got-writable-when-recover-pte-fix.patch This patch will later appear in the mm-hotfixes-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: Peter Xu <peterx@xxxxxxxxxx> Date: Thu, 1 Dec 2022 10:19:22 -0500 Subject: mm-migrate-fix-read-only-page-got-writable-when-recover-pte-fix enhance comment Link: https://lkml.kernel.org/r/Y4jIHureiOd8XjDX@x1n Signed-off-by: Peter Xu <peterx@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Alistair Popple <apopple@xxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Axel Rasmussen <axelrasmussen@xxxxxxxxxx> Cc: Ives van Hoorne <ives@xxxxxxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> Cc: Nadav Amit <nadav.amit@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/mm/migrate.c~mm-migrate-fix-read-only-page-got-writable-when-recover-pte-fix +++ a/mm/migrate.c @@ -214,7 +214,14 @@ static bool remove_migration_pte(struct if (is_writable_migration_entry(entry)) pte = maybe_mkwrite(pte, vma); else - /* NOTE: mk_pte can have write bit set */ + /* + * NOTE: mk_pte() can have write bit set per memory + * type (e.g. shmem), or pte_mkdirty() per archs + * (e.g., sparc64). If this is a read migration + * entry, we need to make sure when we recover the + * pte from migration entry to present entry the + * write bit is cleared. + */ pte = pte_wrprotect(pte); if (pte_swp_uffd_wp(*pvmw.pte)) { _ Patches currently in -mm which might be from peterx@xxxxxxxxxx are mm-migrate-fix-read-only-page-got-writable-when-recover-pte.patch mm-migrate-fix-read-only-page-got-writable-when-recover-pte-fix.patch mm-hugetlb-let-vma_offset_start-to-return-start.patch mm-hugetlb-dont-wait-for-migration-entry-during-follow-page.patch mm-hugetlb-document-huge_pte_offset-usage.patch mm-hugetlb-move-swap-entry-handling-into-vma-lock-when-faulted.patch mm-hugetlb-make-userfaultfd_huge_must_wait-safe-to-pmd-unshare.patch mm-hugetlb-make-hugetlb_follow_page_mask-safe-to-pmd-unshare.patch mm-hugetlb-make-follow_hugetlb_page-safe-to-pmd-unshare.patch mm-hugetlb-make-walk_hugetlb_range-safe-to-pmd-unshare.patch mm-hugetlb-make-page_vma_mapped_walk-safe-to-pmd-unshare.patch mm-hugetlb-introduce-hugetlb_walk.patch mm-hugetlb-introduce-hugetlb_walk-fix.patch mm-hugetlb-introduce-hugetlb_walk-fix-2.patch