From: Imran Khan <imran.f.khan@oracle.com>
To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org,
liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm/vmstat: avoid taking zone lock in /proc/buddyinfo reads
Date: Thu, 4 Jun 2026 21:42:45 +0800 [thread overview]
Message-ID: <20260604134245.1580287-1-imran.f.khan@oracle.com> (raw)
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
next reply other threads:[~2026-06-04 13:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 13:42 Imran Khan [this message]
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-28 20:08 ` Andrew Morton
2026-06-29 10:18 ` Lorenzo Stoakes
2026-06-24 7:17 ` David Hildenbrand (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260604134245.1580287-1-imran.f.khan@oracle.com \
--to=imran.f.khan@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®