Re: [PATCH v2 00/11] mm: thp: always enable mTHP support
From: David Hildenbrand (Arm)
Date: Thu Apr 02 2026 - 04:29:14 EST
On 2/9/26 23:14, Luiz Capitulino wrote:
> Today, if an architecture implements has_transparent_hugepage() and the CPU
> lacks support for PMD-sized pages, the THP code disables all THP, including
> mTHP. In addition, the kernel lacks a well defined API to check for
> PMD-sized page support. It currently relies on has_transparent_hugepage()
> and thp_disabled_by_hw(), but they are not well defined and are tied to
> THP support.
>
> This series addresses both issues by introducing a new well defined API
> to query PMD-sized page support: pgtable_has_pmd_leaves(). Using this
> new helper, we ensure that mTHP remains enabled even when the
> architecture or CPU doesn't support PMD-sized pages.
>
> Thanks to David Hildenbrand for suggesting this improvement and for
> providing guidance (all bugs and misconceptions are mine).
>
> This applies to v6.19, but I tested it on v6.19-rc8+.
Apologies for the delay Luiz (as told you off-list :) ), I'll try going
through this soon so we can start queuing this after -rc1.
--
Cheers,
David