Skip to content

Commit 5fe690a

Browse files
cronflakesakpm00
authored andcommitted
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/[email protected] Signed-off-by: Matthew Cassell <[email protected]> Cc: Domenico Cerasuolo <[email protected]> Cc: "Huang, Ying" <[email protected]> Cc: Li Zhijian <[email protected]> Cc: Yosry Ahmed <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 431c164 commit 5fe690a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

include/linux/vm_event_item.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
5050
PGSTEAL_ANON,
5151
PGSTEAL_FILE,
5252
#ifdef CONFIG_NUMA
53+
PGSCAN_ZONE_RECLAIM_SUCCESS,
5354
PGSCAN_ZONE_RECLAIM_FAILED,
5455
#endif
5556
PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL,

mm/vmscan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7539,7 +7539,9 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order)
75397539
ret = __node_reclaim(pgdat, gfp_mask, order);
75407540
clear_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags);
75417541

7542-
if (!ret)
7542+
if (ret)
7543+
count_vm_event(PGSCAN_ZONE_RECLAIM_SUCCESS);
7544+
else
75437545
count_vm_event(PGSCAN_ZONE_RECLAIM_FAILED);
75447546

75457547
return ret;

mm/vmstat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ const char * const vmstat_text[] = {
13141314
"pgsteal_file",
13151315

13161316
#ifdef CONFIG_NUMA
1317+
"zone_reclaim_success",
13171318
"zone_reclaim_failed",
13181319
#endif
13191320
"pginodesteal",

0 commit comments

Comments
 (0)