Re: [PATCH v2] mm/ksm: keep soft-dirty and uffd-wp when merging a page

From: Kiryl Shutsemau

Date: Wed Oct 21 2026 - 04:59:45 EST


On Wed, Oct 21, 2026 at 10:21:53AM +0200, David Hildenbrand (Arm) wrote:
> > +1. Did it ever actually work there :) Why not just skip them and
> > call it a day :D
>
> I think QEMU just always sets MADV_MERGABLE and later activates uffd. So that
> needs some care to not disable them. So let's rather try to get it fixed properly.
>
> Can you send out proper patches? Thanks!

+1.

Lance's direction is right. Unsharing is not an access: do_wp_page()
already skips the uffd-wp fault on FAULT_FLAG_UNSHARE, and RWP should do
the same.

--
Kiryl Shutsemau / Kirill A. Shutemov