[PATCH] mm/vmstat: avoid taking zone lock in /proc/buddyinfo reads
From: Imran Khan
Date: Thu Jun 04 2026 - 09:56:49 EST
frag_show_print() just reads zone->free_area[order].nr_free, so
it can safely do this without needing the zone->lock.
Pass nolock=true from frag_show(), so that walk_zones_in_node()
can skip the zone->lock acquisition.
Signed-off-by: Imran Khan <imran.f.khan@xxxxxxxxxx>
---
mm/vmstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index f534972f517de..7b93fbf9af092 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1568,7 +1568,7 @@ static void frag_show_print(struct seq_file *m, pg_data_t *pgdat,
static int frag_show(struct seq_file *m, void *arg)
{
pg_data_t *pgdat = (pg_data_t *)arg;
- walk_zones_in_node(m, pgdat, true, false, frag_show_print);
+ walk_zones_in_node(m, pgdat, true, true, frag_show_print);
return 0;
}
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
--
2.34.1