mm: added node_reclaim successes to VM event counters
Subsystems (4)
PATCH 1/1 mm: added 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.
Signed-off-by Matthew Cassell <[email protected]>
--- include/linux/vm_event_item.h | 1 + mm/vmscan.c | 4 +++- mm/vmstat.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
include/linux/vm_event_item.h +1 -0
@@ -50,6 +50,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGSTEAL_ANON, PGSTEAL_FILE,#ifdef CONFIG_NUMA +PGSCAN_ZONE_RECLAIM_SUCCESS ,PGSCAN_ZONE_RECLAIM_FAILED , #endif PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,
mm/vmscan.c +3 -1
@@ -7496,7 +7496,9 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order) ret =__node_reclaim (pgdat, gfp_mask, order);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 );return ret;
mm/vmstat.c +1 -0
@@ -1295,6 +1295,7 @@ const char * const vmstat_text[] = {"pgsteal_file" , #ifdef CONFIG_NUMA +"zone_reclaim_success" ,"zone_reclaim_failed" , #endif "pginodesteal",
Signature · 1 line
2.34.1