Re: [RFC 06/10] mm: debug_vm_pgtable: use pgtable_has_pmd_leaves()
From: David Hildenbrand (Red Hat)
Date: Wed Dec 03 2025 - 17:09:44 EST
On 11/17/25 18:40, David Hildenbrand (Red Hat) wrote:
On 06.11.25 22:28, Luiz Capitulino wrote:
debug_vm_pgtable calls has_transparent_hugepage() in multiple places to
check if PMD-sized pages are supported, use pgtable_has_pmd_leaves()
Is that code even dealing with pages? Likely we really only want to
check whether PMD leaves are supported, independent of any pages.
I recall that some arch protect certain pmd_* helpers under CONFIG_TRANSPARENT_HUGEPAGE.
But it's certainly something to explore, to see if we can just get rid of that without causing compile-time or runtime issues.
instead.
Signed-off-by: Luiz Capitulino <luizcap@xxxxxxxxxx>
---
mm/debug_vm_pgtable.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
index 830107b6dd08..241b36c78ac9 100644
--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -170,7 +170,7 @@ static void __init pmd_basic_tests(struct pgtable_debug_args *args, int idx)
unsigned long val = idx, *ptr = &val;
pmd_t pmd;
- if (!has_transparent_hugepage())
+ if (!pgtable_has_pmd_leaves())
return;
All of these are currently protected by CONFIG_TRANSPARENT_HUGEPAGE, right?
IIUC, yes.
--
Cheers
David