From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Nico Pache <npache@redhat.com>
Cc: Usama Arif <usama.arif@linux.dev>, Zi Yan <ziy@nvidia.com>,
ljs@kernel.org, xu.xin16@zte.com.cn,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
usamaarif642@gmail.com, yuzhao@google.com, aarcange@redhat.com,
akpm@linux-foundation.org, chengming.zhou@linux.dev,
baolin.wang@linux.alibaba.com, liam@infradead.org,
ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org,
lance.yang@linux.dev, matthew.brost@intel.com,
joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com,
gourry@gourry.net, ying.huang@linux.alibaba.com,
apopple@nvidia.com
Subject: Re: [PATCH mm-unstable v1 2/3] mm/migrate.c: Prevent folio splitting from interacting with KSM
Date: Tue, 21 Jul 2026 16:02:11 +0200 [thread overview]
Message-ID: <0b268070-95d2-45bd-aea3-56cefe01dc8c@kernel.org> (raw)
In-Reply-To: <CAA1CXcCsqkV2PrLicY5BnOMp+iJWJxsPn60g_3WXugWQqOFYpg@mail.gmail.com>
On 7/20/26 17:28, Nico Pache wrote:
> On Wed, Jul 15, 2026 at 3:30 AM David Hildenbrand (Arm)
> <david@kernel.org> wrote:
>>
>> On 7/15/26 06:05, Nico Pache wrote:
>>>
>>> This would be a good intermediate solution while allowing backward
>>> compatibility.
>>
>> And an absolute horrible user-visible toggle :)
>>
>>>
>>>
>>> Hmm interesting. We should decide on future changes before committing
>>> to one direction; however, i think the immediate solution would be
>>> what I currently have prepped for v2.
>>>
>>> My v2 follows my RFC alternative approach: skip zeropage remapping if
>>> the split comes from KSM. It also contains the patch (3) from this
>>> version, which skips zeropage remapping if the shrinker is disabled.
>>>
>>>
>>> This is indeed a good question but I don't know the right solution.
>>>
>>> Perhaps we can discuss it here.
>>>
>>> So far here are the potential solutions:
>>> a) skip zeropage remapping if the split comes from KSM
>>> b) skip zeropage remapping completely if the shrinker is disabled
>>> c) Disable KSM THP splitting completely
>>> d) add a skip_huge_page sysfs toggle
>>> e) only scan THPs when memory pressure is present
>>>
>>> (a)+(b) would be my V2 which I can send out whenever.
>>>
>>> (c) is the nuclear option, but perhaps KSM for THP is rather
>>> inefficient and pointless
>>>
>>> (d) could be used with (a) and (b) and allows more flexibility than (c)
>>>
>>> (e) is a more dynamic approach, and could be combined with (b) and (d)
>>>
>>> Let me know what you think :)
>>
>> Where does the current patch set fall into and what's the problem with it?
>
> this series (v1) would be "dont scan VM_MERGEABLE entries when KSM is running"
>
> It stops all VM_MEREABLE entries from being candidates, while the V2 I
> would like to propose goes back to my RFC's alternative solution
> a ) "skip zeropage remapping if the split comes from KSM"
>
> I think (a) is better than V1 as it doesnt indiscriminately target all
> VM_MERGEABLE mapping but rather those that are triggering the issue
> (the split).
Not sure. There could be anything else in the system triggering the split before
KSM comes around.
So v1 just cleanly separates them, independent who triggers the split.
Why is this a problem?
--
Cheers,
David
next prev parent reply other threads:[~2026-07-21 14:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 11:46 [PATCH mm-unstable v1 0/3] MM: Tighten control over zero-page remapping Nico Pache
2026-06-09 11:46 ` [PATCH mm-unstable v1 1/3] mm/ksm: export ksm_is_running() to check KSM merge state Nico Pache
2026-06-09 14:13 ` Lorenzo Stoakes
2026-06-09 11:46 ` [PATCH mm-unstable v1 2/3] mm/migrate.c: Prevent folio splitting from interacting with KSM Nico Pache
2026-06-09 12:12 ` xu.xin16
2026-06-09 12:57 ` Nico Pache
2026-06-09 12:59 ` David Hildenbrand (Arm)
2026-06-09 13:47 ` xu.xin16
2026-06-09 14:07 ` Zi Yan
2026-06-09 17:27 ` Usama Arif
2026-07-15 4:05 ` Nico Pache
2026-07-15 10:54 ` Usama Arif
[not found] ` <a464c20c-8b41-4264-b560-497ed91cbaaa@kernel.org>
2026-07-20 15:28 ` Nico Pache
2026-07-21 14:02 ` David Hildenbrand (Arm) [this message]
2026-07-29 16:54 ` Nico Pache
2026-07-30 8:33 ` David Hildenbrand (Arm)
2026-06-09 13:06 ` Lance Yang
2026-06-09 13:42 ` Nico Pache
2026-06-09 13:49 ` xu.xin16
2026-06-09 14:14 ` Lorenzo Stoakes
2026-06-09 14:26 ` Lorenzo Stoakes
2026-06-09 11:46 ` [PATCH mm-unstable v1 3/3] mm/huge_memory.c: Skip zero-page remapping when underused THP shrinker is disabled Nico Pache
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=0b268070-95d2-45bd-aea3-56cefe01dc8c@kernel.org \
--to=david@kernel.org \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=byungchul@sk.com \
--cc=chengming.zhou@linux.dev \
--cc=dev.jain@arm.com \
--cc=gourry@gourry.net \
--cc=joshua.hahnjy@gmail.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=matthew.brost@intel.com \
--cc=npache@redhat.com \
--cc=rakie.kim@sk.com \
--cc=ryan.roberts@arm.com \
--cc=usama.arif@linux.dev \
--cc=usamaarif642@gmail.com \
--cc=xu.xin16@zte.com.cn \
--cc=ying.huang@linux.alibaba.com \
--cc=yuzhao@google.com \
--cc=ziy@nvidia.com \
/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