mm-ksm-keep-soft-dirty-when-merging-a-page.patch removed from -mm tree
The quilt patch titled
Subject: mm/ksm: keep soft-dirty when merging a page
has been removed from the -mm tree. Its filename was
mm-ksm-keep-soft-dirty-when-merging-a-page.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Samarth Narang <[email protected]>
Subject: mm/ksm: keep soft-dirty when merging a page
Date: Wed, 21 Oct 2026 11:21:57 -0700
replace_page() maps the KSM page with a PTE built from scratch, so the soft-dirty bit of the PTE it replaces is lost. A page written since "clear_refs 4" then no longer shows as soft-dirty once it is merged, and a soft-dirty based dumper treats it as unchanged.
Copy the soft-dirty bit from the original PTE to the new PTE.
---
mm/ksm.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/ksm.c renamed from mm/ksm.c~mm-ksm-keep-soft-dirty-when-merging-a-page +4 -0
@@ -1463,6 +1463,10 @@ static int replace_page(struct vm_area_sdec_mm_counter (mm,MM_ANONPAGES ); } +/* Preserve soft-dirty when replacing the page. */ +if (pte_soft_dirty (orig_pte)) + newpte =pte_mksoft_dirty (newpte); +flush_cache_page (vma, addr,pte_pfn (ptep_get (ptep)));/* * No need to notify as we are replacing a read only page with another
_
Patches currently in -mm which might be from [email protected] are