Re: [PATCH v3] mm/ksm: keep soft-dirty when merging a page
From: David Hildenbrand (Arm)
Date: Mon Oct 26 2026 - 05:45:53 EST
On 10/24/26 07:33, Andrew Morton wrote:
> On Wed, 21 Oct 2026 11:21:57 -0700 Samarth Narang <samarth.colleges@xxxxxxxxx> wrote:
>
>> 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.
>
> Thanks. My LLM review thing says:
>
> : There's a separate, pre-existing problem with the KSM zero-page
> : path which is worth pointing out.
Cool, more AI schlop.
TL;dr Sashiko raised this before and I commented why we don't care IIRC.
--
Cheers,
David