Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/vmstat: avoid taking zone lock in /proc/buddyinfo reads
@ 2026-06-04 13:42 Imran Khan
  2026-06-04 17:04 ` Joshua Hahn
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Imran Khan @ 2026-06-04 13:42 UTC (permalink / raw)
  To: akpm, david, ljs, liam, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, linux-kernel

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@oracle.com>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-24  7:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 13:42 [PATCH] mm/vmstat: avoid taking zone lock in /proc/buddyinfo reads Imran Khan
2026-06-04 17:04 ` Joshua Hahn
2026-06-05 12:14 ` Vlastimil Babka (SUSE)
2026-06-08  8:17 ` Lorenzo Stoakes
2026-06-24  7:16 ` Lorenzo Stoakes
2026-06-24  7:17 ` David Hildenbrand (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox