Re: [PATCH mm-unstable v1 2/3] mm/migrate.c: Prevent folio splitting from interacting with KSM

From: David Hildenbrand (Arm)

Date: Tue Aug 25 2026 - 13:37:13 EST


On 8/5/26 18:27, Nico Pache wrote:
> On Thu, Jul 30, 2026 at 2:34 AM David Hildenbrand (Arm)
> <david@xxxxxxxxxx> wrote:
>>
>> On 7/29/26 18:54, Nico Pache wrote:
>>> On Tue, Jul 21, 2026 at 8:02 AM David Hildenbrand (Arm)
>>> <david@xxxxxxxxxx> wrote:
>>>
>>> Yes but now all VM_MERGEABLEs lose the underutilized shrinker
>>> independent from weather KSM was the one who triggered it.
>>
>> Because KSM takes care of it?
>
> KSM only takes care of it in the case of 'use_zero_pages' being set.
> If we stop KSM splits from reclaiming, we regain the intended sysctl
> behavior; otherwise, KSM splits and reclaims indiscriminately. The
> secondary effect is that if we don't have this toggle set, the split
> would still reclaim these pages. KSM then has to process those pages
> (despite them already being freed), wasting cycles.
>
> Your proposed solution works too, I just think its a more aggressive
> approach (stop all VM_MERGEABLEs from split-reclaiming, not just those
> that are currently being operated on by KSM).

I think we should really just stop two mechanisms to compete entirely: if A is
active for a region, B is disabled.

Not trying to follow "who split what" and operate based on that.

--
Cheers,

David