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

Baolin Wang
2026-04-11T06:57:05Z

On 4/9/26 4:23 AM, 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@redhat.com>
> ---

LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>