lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250918071741.526280-1-ye.liu@linux.dev>
Date: Thu, 18 Sep 2025 15:17:40 +0800
From: Ye Liu <ye.liu@...ux.dev>
To: Andrew Morton <akpm@...ux-foundation.org>,
	David Hildenbrand <david@...hat.com>
Cc: Ye Liu <liuye@...inos.cn>,
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	"Liam R. Howlett" <Liam.Howlett@...cle.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Mike Rapoport <rppt@...nel.org>,
	Suren Baghdasaryan <surenb@...gle.com>,
	Michal Hocko <mhocko@...e.com>,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] mm/vmstat: add header line to /proc/buddyinfo output

From: Ye Liu <liuye@...inos.cn>

Add a header line to /proc/buddyinfo that shows the order numbers
for better readability and clarity.

Before:
Node 0, zone      DMA      0      0      0      0      0      0      0 ...
Node 0, zone    DMA32      5      8      6      6      7      5      8 ...
Node 0, zone   Normal   1113    351    138     65     38     31     25 ...

After:
Free pages per order       0      1      2      3      4      5      6 ...
Node 0, zone      DMA      0      0      0      0      0      0      0 ...
Node 0, zone    DMA32      5      8      6      6      7      5      8 ...
Node 0, zone   Normal   1113    351    138     65     38     31     25 ...

Signed-off-by: Ye Liu <liuye@...inos.cn>
---
 mm/vmstat.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index bb09c032eecf..e9606457ab91 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1574,7 +1574,14 @@ static void frag_show_print(struct seq_file *m, pg_data_t *pgdat,
  */
 static int frag_show(struct seq_file *m, void *arg)
 {
+	int order;
 	pg_data_t *pgdat = (pg_data_t *)arg;
+	/* Print header */
+	seq_printf(m, "%-21s ", "Free pages per order");
+	for (order = 0; order < NR_PAGE_ORDERS; ++order)
+		seq_printf(m, "%6d ", order);
+	seq_putc(m, '\n');
+
 	walk_zones_in_node(m, pgdat, true, false, frag_show_print);
 	return 0;
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ