[PATCH 3/3] mm/vmalloc: extract show_busy_info from vmalloc_info_show
From: Ye Liu
Date: Sun Sep 13 2026 - 23:35:21 EST
From: Ye Liu <liuye@xxxxxxxxxx>
Extract the busy vmap area iteration into show_busy_info, mirroring
the existing show_purge_info pattern.
Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>
---
mm/vmalloc.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 797933ba9451..7638845377f5 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -5345,12 +5345,12 @@ static void show_purge_info(struct seq_file *m)
}
}
-static int vmalloc_info_show(struct seq_file *m, void *p)
+static void show_busy_info(struct seq_file *m)
{
struct vmap_node *vn;
struct vmap_area *va;
struct vm_struct *v;
- unsigned int *counters;
+ unsigned int *counters = NULL;
if (IS_ENABLED(CONFIG_NUMA))
counters = kmalloc_array(nr_node_ids, sizeof(unsigned int), GFP_KERNEL);
@@ -5415,12 +5415,18 @@ static int vmalloc_info_show(struct seq_file *m, void *p)
spin_unlock(&vn->busy.lock);
}
+ if (IS_ENABLED(CONFIG_NUMA))
+ kfree(counters);
+}
+
+static int vmalloc_info_show(struct seq_file *m, void *p)
+{
+ show_busy_info(m);
+
/*
* As a final step, dump "unpurged" areas.
*/
show_purge_info(m);
- if (IS_ENABLED(CONFIG_NUMA))
- kfree(counters);
return 0;
}
--
2.25.1