Re: [PATCH v3 08/10] mm: replace thp_disabled_by_hw() with pgtable_has_pmd_leaves()

Zi Yan
2026-04-09T15:44:02Z

On 8 Apr 2026, at 16:23, Luiz Capitulino wrote:

> Despite its name, thp_disabled_by_hw() just checks whether the
> architecture supports PMD-sized pages. It returns true when
> TRANSPARENT_HUGEPAGE_UNSUPPORTED is set in transparent_hugepage_flags,
> this only occurs if the architecture implements arch_has_pmd_leaves()
> and that function returns false.
>
> Since pgtable_has_pmd_leaves() provides the same semantics, use it
> instead.
>
> Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
> ---
> include/linux/huge_mm.h | 7 -------
> mm/huge_memory.c | 6 ++----
> mm/memory.c | 2 +-
> mm/shmem.c | 2 +-
> 4 files changed, 4 insertions(+), 13 deletions(-)
>

LGTM.

Acked-by: Zi Yan <ziy@nvidia.com>

Best Regards,
Yan, Zi