mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
mm: move pgscan, pgsteal, pgrefill to node stats
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. Link: https://lkml.kernel.org/r/20260219235846.161910-1-jp.kobryn@linux.dev Signed-off-by: JP Kobryn <jp.kobryn@linux.dev> Suggested-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Shakeel Butt <shakeel.butt@linux.dev> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: Axel Rasmussen <axelrasmussen@google.com> Cc: Byungchul Park <byungchul@sk.com> Cc: David Hildenbrand <david@kernel.org> Cc: Eugenio Pérez <eperezma@redhat.com> Cc: Gregory Price <gourry@gourry.net> Cc: "Huang, Ying" <ying.huang@linux.alibaba.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Joshua Hahn <joshua.hahnjy@gmail.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Mathew Brost <matthew.brost@intel.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Qi Zheng <zhengqi.arch@bytedance.com> Cc: Rakie Kim <rakie.kim@sk.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Wei Xu <weixugc@google.com> Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Cc: Yuanchu Xie <yuanchu@google.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
54218f10df
commit
e4f4fc7aa8
26
mm/vmstat.c
26
mm/vmstat.c
@@ -1276,6 +1276,19 @@ const char * const vmstat_text[] = {
|
||||
[I(PGDEMOTE_DIRECT)] = "pgdemote_direct",
|
||||
[I(PGDEMOTE_KHUGEPAGED)] = "pgdemote_khugepaged",
|
||||
[I(PGDEMOTE_PROACTIVE)] = "pgdemote_proactive",
|
||||
[I(PGSTEAL_KSWAPD)] = "pgsteal_kswapd",
|
||||
[I(PGSTEAL_DIRECT)] = "pgsteal_direct",
|
||||
[I(PGSTEAL_KHUGEPAGED)] = "pgsteal_khugepaged",
|
||||
[I(PGSTEAL_PROACTIVE)] = "pgsteal_proactive",
|
||||
[I(PGSTEAL_ANON)] = "pgsteal_anon",
|
||||
[I(PGSTEAL_FILE)] = "pgsteal_file",
|
||||
[I(PGSCAN_KSWAPD)] = "pgscan_kswapd",
|
||||
[I(PGSCAN_DIRECT)] = "pgscan_direct",
|
||||
[I(PGSCAN_KHUGEPAGED)] = "pgscan_khugepaged",
|
||||
[I(PGSCAN_PROACTIVE)] = "pgscan_proactive",
|
||||
[I(PGSCAN_ANON)] = "pgscan_anon",
|
||||
[I(PGSCAN_FILE)] = "pgscan_file",
|
||||
[I(PGREFILL)] = "pgrefill",
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
[I(NR_HUGETLB)] = "nr_hugetlb",
|
||||
#endif
|
||||
@@ -1318,21 +1331,8 @@ const char * const vmstat_text[] = {
|
||||
[I(PGMAJFAULT)] = "pgmajfault",
|
||||
[I(PGLAZYFREED)] = "pglazyfreed",
|
||||
|
||||
[I(PGREFILL)] = "pgrefill",
|
||||
[I(PGREUSE)] = "pgreuse",
|
||||
[I(PGSTEAL_KSWAPD)] = "pgsteal_kswapd",
|
||||
[I(PGSTEAL_DIRECT)] = "pgsteal_direct",
|
||||
[I(PGSTEAL_KHUGEPAGED)] = "pgsteal_khugepaged",
|
||||
[I(PGSTEAL_PROACTIVE)] = "pgsteal_proactive",
|
||||
[I(PGSCAN_KSWAPD)] = "pgscan_kswapd",
|
||||
[I(PGSCAN_DIRECT)] = "pgscan_direct",
|
||||
[I(PGSCAN_KHUGEPAGED)] = "pgscan_khugepaged",
|
||||
[I(PGSCAN_PROACTIVE)] = "pgscan_proactive",
|
||||
[I(PGSCAN_DIRECT_THROTTLE)] = "pgscan_direct_throttle",
|
||||
[I(PGSCAN_ANON)] = "pgscan_anon",
|
||||
[I(PGSCAN_FILE)] = "pgscan_file",
|
||||
[I(PGSTEAL_ANON)] = "pgsteal_anon",
|
||||
[I(PGSTEAL_FILE)] = "pgsteal_file",
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
[I(PGSCAN_ZONE_RECLAIM_SUCCESS)] = "zone_reclaim_success",
|
||||
|
||||
Reference in New Issue
Block a user