[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02c8cf41-116d-46ab-9d40-803cc26dbbf8@redhat.com>
Date: Tue, 30 Sep 2025 09:32:24 +0200
From: David Hildenbrand <david@...hat.com>
To: Lance Yang <lance.yang@...ux.dev>
Cc: xu.xin16@....com.cn, chengming.zhou@...ux.dev, ran.xiaokai@....com.cn,
yang.yang29@....com.cn, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
ioworker0@...il.com, akpm@...ux-foundation.org
Subject: Re: [PATCH 1/1] mm/ksm: fix spurious soft-dirty bit on zero-filled
page merging
On 29.09.25 12:08, Lance Yang wrote:
>
>
> On 2025/9/29 16:25, David Hildenbrand wrote:
>> On 28.09.25 06:52, Lance Yang wrote:
>>> From: Lance Yang <lance.yang@...ux.dev>
>>>
>>> When KSM merges a zero-filled page with the shared zeropage, it uses
>>> pte_mkdirty() to mark the new PTE for internal accounting. However,
>>> pte_mkdirty() unconditionally sets both the hardware dirty bit and the
>>> soft-dirty bit.
>>>
>>
>> Right, that's one think we should clean up at one point.
>
> Got it. I’ll take a look when I get a chance ;)
>
>>
>>> This behavior causes false positives in userspace tools like CRIU that
>>> rely on the soft-dirty mechanism for tracking memory changes.
>>
>> IIRC, false positives are not a problem. We get them all of the time
>> when merging VMAs etc.
>
> Right, Indeed.
>
>> So I am not sure if this here is really worth fixing. Soft-dirty is not,
>> and never will be false-positive free.
>
> Makes sense to me. It doesn’t seem worth the trouble to fix. Let’s go
> ahead and drop it.
Yeah, I would prefer if we can just decouple soft-dirty from dirty
handling at some point. I recall I had a use case around
PageAnonExclusive at some point.
--
Cheers
David / dhildenb
Powered by blists - more mailing lists