From: "David Hildenbrand (Arm)" <david@kernel.org>
To: xu.xin16@zte.com.cn, akpm@linux-foundation.org
Cc: chengming.zhou@linux.dev, hughd@google.com,
wang.yaxin@zte.com.cn, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, ljs@kernel.org
Subject: Re: [PATCH v11 0/3] KSM: performance optimizations for rmap_walk_ksm
Date: Mon, 6 Jul 2026 08:49:34 +0200 [thread overview]
Message-ID: <f986205b-1792-497e-aacb-2789e87a4483@kernel.org> (raw)
In-Reply-To: <20260706124039747M7gtCsrOvuzDyfLMXIJ2B@zte.com.cn>
On 7/6/26 06:40, xu.xin16@zte.com.cn wrote:
>> Again, thanks for persisting with this. Great improvement and I'd love
>> to see us get this finished off.
>>
>> Please have a look through the AI review:
>>
>> https://sashiko.dev/#/patchset/20260703162253688u8Str9eFLR8TGCmo7nIOF@zte.com.cn
>>
>> That 32-bit thing looks legit, kinda fatal but easy to address.
>>
>
> Hi, Andrew, This is not a major issue. I think it's acceptable and detailed
> analysis is as follows:
>
> The sashiko said:
> "
>> Looking at struct ksm_rmap_item in mm/ksm.c, the linear_page_index (unsigned
>> long) is placed in a union with an anonymous struct containing oldchecksum
>> (unsigned int), age (rmap_age_t, 1 byte), and remaining_skips (rmap_age_t,
>> 1 byte).
>> On 32-bit platforms, an unsigned long is only 4 bytes, while the anonymous
>> struct is at least 6 bytes. When break_cow(), remove_node_from_stable_tree(),
>> and remove_rmap_item_from_tree() assign rmap_item->linear_page_index = 0 to
>> reset the age-related information, it appears this will only zero the first 4
>> bytes (clearing oldchecksum). The age and remaining_skips fields would retain
>> their stale historical values from before the page was originally merged.
>
> Indeed, on 32-bit CPU, that patch doesn't clear age-related information, but it
> doesn't introduce any issue because at this point the linear_page_index and
> age-related information do not overlap, and there is no conflict between them.
> This is clearly consistent with the logic before applying the patch, so there
> won't be any problem.
It keeps bringing that up, and we clearly document "might overlay age-related
information". So just ignore this.
--
Cheers,
David
prev parent reply other threads:[~2026-07-06 6:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 8:22 [PATCH v11 0/3] KSM: performance optimizations for rmap_walk_ksm xu.xin16
2026-07-03 8:23 ` [PATCH v11 1/3] ksm: add linear_page_index into ksm_rmap_item xu.xin16
2026-07-03 8:25 ` [PATCH v11 2/3] ksm: Optimize rmap_walk_ksm by passing a suitable page index xu.xin16
2026-07-06 6:53 ` David Hildenbrand (Arm)
2026-07-03 8:26 ` [PATCH v11 3/3] ksm: add mremap selftests for ksm_rmap_walk xu.xin16
2026-07-06 6:55 ` David Hildenbrand (Arm)
2026-07-05 8:00 ` [PATCH v11 0/3] KSM: performance optimizations for rmap_walk_ksm Andrew Morton
2026-07-06 4:40 ` xu.xin16
2026-07-06 6:49 ` David Hildenbrand (Arm) [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=f986205b-1792-497e-aacb-2789e87a4483@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=wang.yaxin@zte.com.cn \
--cc=xu.xin16@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