From: Andrew Morton <akpm@linux-foundation.org>
To: Hao Ge <hao.ge@linux.dev>
Cc: David Hildenbrand <david@kernel.org>,
linux-mm@kvack.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/balloon: expose per-node balloon pages in node meminfo
Date: Fri, 8 May 2026 11:31:23 -0700 [thread overview]
Message-ID: <20260508113123.c8e653484d39e76cdd6e142e@linux-foundation.org> (raw)
In-Reply-To: <20260508094736.142467-1-hao.ge@linux.dev>
On Fri, 8 May 2026 17:47:36 +0800 Hao Ge <hao.ge@linux.dev> wrote:
> Commit 835de37603ef ("meminfo: add a per node counter for balloon
> drivers") added NR_BALLOON_PAGES and exposed it in /proc/meminfo.
> However, the per-node view at /sys/devices/system/node/nodeX/meminfo
> was not updated, even though the counter is already tracked per-node.
>
> Add it to node_read_meminfo() so users can see balloon usage per
> NUMA node without having to parse the raw vmstat file.
>
> ...
>
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -523,6 +523,7 @@ static ssize_t node_read_meminfo(struct device *dev,
> #ifdef CONFIG_UNACCEPTED_MEMORY
> "Node %d Unaccepted: %8lu kB\n"
> #endif
> + "Node %d Balloon: %8lu kB\n"
> ,
> nid, K(node_page_state(pgdat, NR_FILE_DIRTY)),
> nid, K(node_page_state(pgdat, NR_WRITEBACK)),
> @@ -556,6 +557,8 @@ static ssize_t node_read_meminfo(struct device *dev,
> ,
> nid, K(sum_zone_node_page_state(nid, NR_UNACCEPTED))
> #endif
> + ,
> + nid, K(node_page_state(pgdat, NR_BALLOON_PAGES))
> );
> len += hugetlb_report_node_meminfo(buf, len, nid);
> return len;
This was prepared against a kernel whcih didn't have 2232ba9c7931 ("mm:
add gpu active/reclaim per-node stat counters (v2)"). Which was added
in February, btw.
Please check my fixings:
--- a/drivers/base/node.c~mm-balloon-expose-per-node-balloon-pages-in-node-meminfo
+++ a/drivers/base/node.c
@@ -525,6 +525,7 @@ static ssize_t node_read_meminfo(struct
#endif
"Node %d GPUActive: %8lu kB\n"
"Node %d GPUReclaim: %8lu kB\n"
+ "Node %d Balloon: %8lu kB\n"
,
nid, K(node_page_state(pgdat, NR_FILE_DIRTY)),
nid, K(node_page_state(pgdat, NR_WRITEBACK)),
@@ -560,7 +561,8 @@ static ssize_t node_read_meminfo(struct
#endif
,
nid, K(node_page_state(pgdat, NR_GPU_ACTIVE)),
- nid, K(node_page_state(pgdat, NR_GPU_RECLAIM))
+ nid, K(node_page_state(pgdat, NR_GPU_RECLAIM)),
+ nid, K(node_page_state(pgdat, NR_BALLOON_PAGES))
);
len += hugetlb_report_node_meminfo(buf, len, nid);
return len;
_
next prev parent reply other threads:[~2026-05-08 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 9:47 [PATCH v2] mm/balloon: expose per-node balloon pages in node meminfo Hao Ge
2026-05-08 10:57 ` David Hildenbrand (Arm)
2026-05-08 18:31 ` Andrew Morton [this message]
2026-05-09 1:14 ` Hao Ge
2026-05-09 1:07 ` SeongJae Park
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=20260508113123.c8e653484d39e76cdd6e142e@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=hao.ge@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=virtualization@lists.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