Re: [PATCH 00/14] mm/ksm: merge-path cleanups and folio conversion

From: Longlong Xia

Date: Wed Sep 16 2026 - 04:50:26 EST



On 2026/9/16 14:37, David Hildenbrand (Arm) wrote:
On 9/16/26 00:25, Longlong Xia wrote:
Thanks for the review. You are right that I did not justify the
page/folio boundary clearly enough.

Patches 11-13 only avoid converting the target page back to a folio and
provide no functional or performance benefit by themselves.

I will separate the independent cleanups and drop or rework 11-13 after
getting guidance from the KSM maintainers. I also found a NULL/bisectability
issue in v1 patch 12, which I will fix before any follow-up.
In general: once we have a ksm folio (folio_test_ksm()), it can only be a small
folio and we can operate on the folio only.

Until that point, we really need the page, because we might be dealing with a
page in a large folio. Sure, we can carry a folio+page pair to reduce repeated
folio lookups, but be aware that we have to re-lookup the folio and take care of
references whenever we call into something that could end up splitting the
folio. So we have to be a bit careful around that.

Hi David,

Thanks for the clarification. I understand that the page must be retained until we confirm it is a KSM folio.

I will drop patches 11–13 from this series and send a new version without them. Any reworked folio conversion patches will be sent separately later.

Best regards,
Longlong