Commit 5fe690a5 authored by Matthew Cassell's avatar Matthew Cassell Committed by Andrew Morton

mm: add node_reclaim successes to VM event counters

/proc/vmstat currently shows the number of node_reclaim() failures when
vm.zone_reclaim_mode is set appropriately.  It would be convenient to have
the number of successes right next to zone_reclaim_failed (similar to
compaction and migration).

While just a trivially addition to the vmstat file.  It was helpful during
benchmarking to not have to probe node_reclaim() to observe the
success/failure ratio.

Link: https://lkml.kernel.org/r/20240722171316.7517-1-mcassell411@gmail.comSigned-off-by: default avatarMatthew Cassell <mcassell411@gmail.com>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Li Zhijian <lizhijian@fujitsu.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 431c1646
...@@ -50,6 +50,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, ...@@ -50,6 +50,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
PGSTEAL_ANON, PGSTEAL_ANON,
PGSTEAL_FILE, PGSTEAL_FILE,
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
PGSCAN_ZONE_RECLAIM_SUCCESS,
PGSCAN_ZONE_RECLAIM_FAILED, PGSCAN_ZONE_RECLAIM_FAILED,
#endif #endif
PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
......
...@@ -7539,7 +7539,9 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order) ...@@ -7539,7 +7539,9 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
ret = __node_reclaim(pgdat, gfp_mask, order); ret = __node_reclaim(pgdat, gfp_mask, order);
clear_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags); clear_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags);
if (!ret) if (ret)
count_vm_event(PGSCAN_ZONE_RECLAIM_SUCCESS);
else
count_vm_event(PGSCAN_ZONE_RECLAIM_FAILED); count_vm_event(PGSCAN_ZONE_RECLAIM_FAILED);
return ret; return ret;
......
...@@ -1314,6 +1314,7 @@ const char * const vmstat_text[] = { ...@@ -1314,6 +1314,7 @@ const char * const vmstat_text[] = {
"pgsteal_file", "pgsteal_file",
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
"zone_reclaim_success",
"zone_reclaim_failed", "zone_reclaim_failed",
#endif #endif
"pginodesteal", "pginodesteal",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment