lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f4876a6-796d-4d08-9944-730be05b7088@kernel.org>
Date: Mon, 17 Nov 2025 18:32:16 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Luiz Capitulino <luizcap@...hat.com>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org
Cc: ryan.roberts@....com, akpm@...ux-foundation.org,
 lorenzo.stoakes@...cle.com
Subject: Re: [RFC 05/10] drivers: nvdimm: use pgtable_has_pmd_leaves()

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@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ