Re: [PATCH v1 2/2] mm/memory: add anonymous mTHP folios to deferred split list

Usama Arif <[email protected]> Tue, 4 Aug 2026 15:39:12 +0100
Newsgroups org.kvack.linux-mm
Message-ID <[email protected]>

On 04/08/2026 03:03, Barry Song wrote:
> On Tue, Aug 4, 2026 at 8:48 AM Johannes Weiner <[email protected]> wrote:
>>
> [...]
>>>
>>> #define LARGE_FOLIO_ZERO_SCAN_MIN_SIZE SZ_2M
>>>
>>> if (folio_size(folio) >= LARGE_FOLIO_ZERO_SCAN_MIN_SIZE)
>>>      deferred_split_folio(folio, false);
>>>
>>> If, someday, people find that 1 MiB also helps, they can provide
>>> data to support it.
>>
>> I am very confused. Did you not see my proposal above?
>>
>> Why not this?
> 
> Hi Johannes,
> 
> For arm64, if the base page size is 64KB, a PMD would be 512MB,
> and PMD-1 would be 256MB. Usama mentioned 2MB, which is just
> order-5, not PMD-1 on arm64.
> 
> BTW, I assume khugepaged_max_ptes_none is intended for collapse,
> not splitting. I am a bit concerned that reusing it for this
> purpose would be quite disruptive.
> 
We have to use the same parameter for both collapse and splitting.

For example if you use a new parameter for splitting which is set
higher than the value for collapse, then khugepaged and shrinker
will constantly thrash each other. khugepaged will collapse
and shrinker will break it down.