[RFC 02/10] mm/vmalloc: Skip vmallocinfo NUMA stats for VM_SPARSE
From: David Stevens
Date: Thu Aug 27 2026 - 19:31:54 EST
Bail from show_numa_info() in vmalloc_info_show() for areas with
VM_SPARSE set. This lets clients that allocate VM_SPARSE areas directly
use vm_struct's nr_pages and pages fields.
Signed-off-by: David Stevens <stevensd@xxxxxxxxxx>
---
mm/vmalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f4fa227a8d7f..d39897300f29 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -5294,6 +5294,9 @@ static void show_numa_info(struct seq_file *m, struct vm_struct *v,
if (!counters)
return;
+ if (v->flags & VM_SPARSE)
+ return;
+
memset(counters, 0, nr_node_ids * sizeof(unsigned int));
for (nr = 0; nr < v->nr_pages; nr += step)
--
2.55.0.897.gb25b4bd76c-goog