Re: [PATCH v2 00/11] mm: thp: always enable mTHP support
From: Luiz Capitulino
Date: Thu Apr 02 2026 - 08:06:37 EST
On 2026-04-02 04:25, David Hildenbrand (Arm) wrote:
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.
Oh, wow, thanks for the support!
I intended to get back to this series this week to address Baolin's
comments, but I got busy with other things (which is something I may
bring up on upstream but it's not related to this series at all).