From: Lance Yang <lance.yang@linux.dev>
To: David Hildenbrand <david@redhat.com>
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 15:36:36 +0800 [thread overview]
Message-ID: <556e072d-6bec-421a-a78c-fcde61af67f9@linux.dev> (raw)
In-Reply-To: <02c8cf41-116d-46ab-9d40-803cc26dbbf8@redhat.com>
On 2025/9/30 15:32, David Hildenbrand wrote:
> 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.
Cool. I'll give it a try ;)
prev parent reply other threads:[~2025-09-30 7:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-28 4:52 Lance Yang
2025-09-29 8:25 ` David Hildenbrand
2025-09-29 10:08 ` Lance Yang
2025-09-30 7:32 ` David Hildenbrand
2025-09-30 7:36 ` Lance Yang [this message]
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=556e072d-6bec-421a-a78c-fcde61af67f9@linux.dev \
--to=lance.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=david@redhat.com \
--cc=ioworker0@gmail.com \
--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