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

From: David Hildenbrand (Arm)

Date: Wed Jul 15 2026 - 05:37:01 EST


On 7/15/26 10:56, xu.xin16@xxxxxxxxxx wrote:
>> 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 :)
>> -- Nico
>
> Maybe (f): contains c+d+e: as a general and compromise approach to maintain
> backward compatibility, providing a skip_huge_page switch with three options
> — [always], [memory_sufficient], and [never] — could be a viable solution.

Any new toggle for this is the wrong approach, so d) is not an option :)

--
Cheers,

David