Re: [PATCH v3 06/10] mm: shmem: drop has_transparent_hugepage() usage

From: Zi Yan

Date: Thu Apr 09 2026 - 11:31:32 EST


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

> Shmem uses has_transparent_hugepage() in the following ways:
>
> - shmem_parse_one() and shmem_parse_huge(): Check if THP is built-in and
> if the CPU supports PMD-sized pages
>
> - shmem_init(): Since the CONFIG_TRANSPARENT_HUGEPAGE guard is outside
> the code block calling has_transparent_hugepage(), the
> has_transparent_hugepage() call is exclusively checking if the CPU
> supports PMD-sized pages
>
> While it's necessary to check if CONFIG_TRANSPARENT_HUGEPAGE is enabled
> in all cases, shmem can determine mTHP size support at folio allocation
> time. Therefore, drop has_transparent_hugepage() usage while keeping the
> CONFIG_TRANSPARENT_HUGEPAGE checks.
>
> Signed-off-by: Luiz Capitulino <luizcap@xxxxxxxxxx>
> ---
> mm/shmem.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
Makes sense to me.

Acked-by: Zi Yan <ziy@xxxxxxxxxx>

Best Regards,
Yan, Zi