On 06.11.25 22:28, Luiz Capitulino wrote:
> nd_pfn_supported_alignments() and nd_pfn_supported_alignments() use
> has_transparent_hugepage() to check if PMD-sized pages are supported,
> use pgtable_has_pmd_leaves() instead.
>
> Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
> ---
> drivers/nvdimm/pfn_devs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
> index 42b172fc5576..989f87f07e0c 100644
> --- a/drivers/nvdimm/pfn_devs.c
> +++ b/drivers/nvdimm/pfn_devs.c
> @@ -94,7 +94,7 @@ static unsigned long *nd_pfn_supported_alignments(unsigned long *alignments)
>
> alignments[0] = PAGE_SIZE;
>
> - if (has_transparent_hugepage()) {
> + if (pgtable_has_pmd_leaves()) {
> alignments[1] = HPAGE_PMD_SIZE;
> if (has_transparent_pud_hugepage())
Yeah, that should become pgtable_has_pud_leaves() later.
> alignments[2] = HPAGE_PUD_SIZE;
> @@ -109,7 +109,7 @@ static unsigned long *nd_pfn_supported_alignments(unsigned long *alignments)
> static unsigned long nd_pfn_default_alignment(void)
> {
>
> - if (has_transparent_hugepage())
> + if (pgtable_has_pmd_leaves())
> return HPAGE_PMD_SIZE;
> return PAGE_SIZE;
> }
Similar question, what if the kernel would be built without
CONFIG_TRANSPARENT_HUGEPAGE, would it matter here?
In that case, an additional eary "if
(!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))" might do the trick.
--
Cheers
David