From: Michal Hocko <mhocko@suse.com>
To: Ye Liu <ye.liu@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>, Ye Liu <liuye@kylinos.cn>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/vmstat: add header line to /proc/buddyinfo output
Date: Thu, 18 Sep 2025 09:29:27 +0200 [thread overview]
Message-ID: <aMu01xIkj-3hgW88@tiehlicka> (raw)
In-Reply-To: <20250918071741.526280-1-ye.liu@linux.dev>
On Thu 18-09-25 15:17:40, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.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 ...
Why is this needed? And have you considered tha this might break
existing parsers of the file?
>
> Signed-off-by: Ye Liu <liuye@kylinos.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
>
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2025-09-18 7:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 7:17 Ye Liu
2025-09-18 7:29 ` Michal Hocko [this message]
2025-09-18 8:11 ` Ye Liu
2025-09-18 8:16 ` David Hildenbrand
2025-09-18 8:31 ` Ye Liu
2025-09-18 8:49 ` Michal Hocko
2025-09-18 9:00 ` Ye Liu
2025-09-18 8:50 ` David Hildenbrand
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=aMu01xIkj-3hgW88@tiehlicka \
--to=mhocko@suse.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=lorenzo.stoakes@oracle.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ye.liu@linux.dev \
/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