Re: [PATCH v8 14/14] mm: thp: always enable mTHP support
From: Baolin Wang
Date: Fri Sep 18 2026 - 05:23:15 EST
On 9/18/26 9:45 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>
---
LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>