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

From: Lance Yang

Date: Wed Oct 21 2026 - 12:20:11 EST


Hi Samarth,

Could you send a v3 with just the soft-dirty fix, as David
suggested? Leave the uffd-wp/RWP bits to me (I'll take
a closer look).

On 2026/10/21 17:49, Lance Yang wrote:


On 2026/10/21 16:55, Kiryl Shutsemau wrote:
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!

Thanks David! Will take it over next week and get proper patches out :)


+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.

Thanks Kiryl! Will take a close look at that :)

Cheers, Lance