From: David Hildenbrand <david@redhat.com>
To: Lance Yang <lance.yang@linux.dev>
Cc: xu.xin16@zte.com.cn, chengming.zhou@linux.dev,
ran.xiaokai@zte.com.cn, yang.yang29@zte.com.cn,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
ioworker0@gmail.com, akpm@linux-foundation.org
Subject: Re: [PATCH 1/1] mm/ksm: fix spurious soft-dirty bit on zero-filled page merging
Date: Tue, 30 Sep 2025 09:32:24 +0200 [thread overview]
Message-ID: <02c8cf41-116d-46ab-9d40-803cc26dbbf8@redhat.com> (raw)
In-Reply-To: <8476e9be-3f80-4d7a-9a38-f910661e61c6@linux.dev>
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@linux.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
next prev parent reply other threads:[~2025-09-30 7:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-28 4:52 [PATCH 1/1] mm/ksm: fix spurious soft-dirty bit on zero-filled page merging Lance Yang
2025-09-29 8:25 ` David Hildenbrand
2025-09-29 10:08 ` Lance Yang
2025-09-30 7:32 ` David Hildenbrand [this message]
2025-09-30 7:36 ` Lance Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02c8cf41-116d-46ab-9d40-803cc26dbbf8@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=ioworker0@gmail.com \
--cc=lance.yang@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ran.xiaokai@zte.com.cn \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox