Re: [PATCH v5] mm: move pgscan, pgsteal, pgrefill to node stats
From: Zi Yan
Date: Thu Feb 19 2026 - 19:50:31 EST
On 19 Feb 2026, at 18:58, JP Kobryn (Meta) wrote:
> There are situations where reclaim kicks in on a system with free memory.
> One possible cause is a NUMA imbalance scenario where one or more nodes are
> under pressure. It would help if we could easily identify such nodes.
>
> Move the pgscan, pgsteal, and pgrefill counters from vm_event_item to
> node_stat_item to provide per-node reclaim visibility. With these counters
> as node stats, the values are now displayed in the per-node section of
> /proc/zoneinfo, which allows for quick identification of the affected
> nodes.
>
> /proc/vmstat continues to report the same counters, aggregated across all
> nodes. But the ordering of these items within the readout changes as they
> move from the vm events section to the node stats section.
>
> Memcg accounting of these counters is preserved. The relocated counters
> remain visible in memory.stat alongside the existing aggregate pgscan and
> pgsteal counters.
>
> However, this change affects how the global counters are accumulated.
> Previously, the global event count update was gated on !cgroup_reclaim(),
> excluding memcg-based reclaim from /proc/vmstat. Now that
> mod_lruvec_state() is being used to update the counters, the global
> counters will include all reclaim. This is consistent with how pgdemote
> counters are already tracked.
>
> Finally, the virtio_balloon driver is updated to use
> global_node_page_state() to fetch the counters, as they are no longer
> accessible through the vm_events array.
>
> Signed-off-by: JP Kobryn <jp.kobryn@xxxxxxxxx>
> Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
> v5:
> - rebase onto mm/mm-new
>
> v4: https://lore.kernel.org/linux-mm/20260219171124.19053-1-jp.kobryn@xxxxxxxxx/
> - remove unused memcg var from scan_folios()
>
> v3: https://lore.kernel.org/linux-mm/20260218222652.108411-1-jp.kobryn@xxxxxxxxx/
> - additionally move PGREFILL to node stats
>
> v2: https://lore.kernel.org/linux-mm/20260218032941.225439-1-jp.kobryn@xxxxxxxxx/
> - update commit message
> - add entries to memory_stats array
> - add switch cases in memcg_page_state_output_unit()
>
> v1: https://lore.kernel.org/linux-mm/20260212045109.255391-3-inwardvessel@xxxxxxxxx/
>
> drivers/virtio/virtio_balloon.c | 8 ++---
> include/linux/mmzone.h | 13 ++++++++
> include/linux/vm_event_item.h | 13 --------
> mm/memcontrol.c | 56 +++++++++++++++++++++++----------
> mm/vmscan.c | 39 ++++++++---------------
> mm/vmstat.c | 26 +++++++--------
> 6 files changed, 82 insertions(+), 73 deletions(-)
>
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi