Re: [PATCH v4 9/9] mm: thp: always enable mTHP support
From: Baolin Wang
Date: Wed May 06 2026 - 01:46:46 EST
On 5/2/26 3:18 AM, Luiz Capitulino wrote:
If PMD-sized pages are not supported on an architecture (ie. the
arch implements arch_has_pmd_leaves() and it returns false) then the
current code disables all THP, including mTHP.
This commit fixes this by allowing mTHP to be always enabled for all
archs. When PMD-sized pages are not supported, its sysfs entry won't be
created and their mapping will be disallowed at page-fault time.
Similarly, this commit implements the following changes for shmem in
shmem_allowable_huge_orders():
- Drop the pgtable_has_pmd_leaves() check so that mTHP sizes are
considered
- Filter out PMD and PUD orders from allowable orders when
PMD-sized pages are not supported by the CPU
Signed-off-by: Luiz Capitulino <luizcap@xxxxxxxxxx>
---
Nothing else caught my eye. Thanks. Feel free to add:
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>