The patch titled Subject: mm/migrate: preserve soft dirty in remove_migration_pte() has been added to the -mm tree. Its filename is mm-migrate-preserve-soft-dirty-in-remove_migration_pte.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-migrate-preserve-soft-dirty-in-remove_migration_pte.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-migrate-preserve-soft-dirty-in-remove_migration_pte.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: Ralph Campbell <rcampbell@xxxxxxxxxx> Subject: mm/migrate: preserve soft dirty in remove_migration_pte() The code to remove a migration PTE and replace it with a device private PTE was not copying the soft dirty bit from the migration entry. This could lead to page contents not being marked dirty when faulting the page back from device private memory. Link: https://lkml.kernel.org/r/20200831212222.22409-3-rcampbell@xxxxxxxxxx Signed-off-by: Ralph Campbell <rcampbell@xxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Cc: Jerome Glisse <jglisse@xxxxxxxxxx> Cc: Alistair Popple <apopple@xxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Jason Gunthorpe <jgg@xxxxxxxxxx> Cc: Bharata B Rao <bharata@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/migrate.c~mm-migrate-preserve-soft-dirty-in-remove_migration_pte +++ a/mm/migrate.c @@ -249,6 +249,8 @@ static bool remove_migration_pte(struct if (unlikely(is_device_private_page(new))) { entry = make_device_private_entry(new, pte_write(pte)); pte = swp_entry_to_pte(entry); + if (pte_swp_soft_dirty(*pvmw.pte)) + pte = pte_swp_mksoft_dirty(pte); if (pte_swp_uffd_wp(*pvmw.pte)) pte = pte_swp_mkuffd_wp(pte); } _ Patches currently in -mm which might be from rcampbell@xxxxxxxxxx are mm-migrate-remove-unnecessary-is_zone_device_page-check.patch mm-migrate-preserve-soft-dirty-in-remove_migration_pte.patch mm-thp-fix-__split_huge_pmd_locked-for-migration-pmd.patch mm-test-use-the-new-skip-macro.patch mm-migrate-remove-cpages-in-migrate_vma_finalize.patch mm-migrate-remove-obsolete-comment-about-device-public.patch