mm: fix up the vmscan stat in vmstat
Subsystems (4)
PATCH 1/1 mm: fix up the vmscan stat in vmstat
It is always confusing on stat "pgsteal" where it counts both direct reclaim as well as background reclaim. However, we have "kswapd_steal" which also counts background reclaim value.
This patch fixes it and also makes it match the existng "pgscan_" stats.
Test:pgsteal_kswapd_dma32 447623pgsteal_kswapd_normal 42272677pgsteal_kswapd_movable 0pgsteal_direct_dma32 2801pgsteal_direct_normal 44353270pgsteal_direct_movable 0
--- include/linux/vm_event_item.h | 5 +++-- mm/vmscan.c | 11 ++++++++--- mm/vmstat.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-)
include/linux/vm_event_item.h +3 -2
@@ -26,13 +26,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,PGFREE ,PGACTIVATE ,PGDEACTIVATE ,PGFAULT ,PGMAJFAULT ,FOR_ALL_ZONES (PGREFILL ), -FOR_ALL_ZONES (PGSTEAL ), +FOR_ALL_ZONES (PGSTEAL_KSWAPD ), +FOR_ALL_ZONES (PGSTEAL_DIRECT ),FOR_ALL_ZONES (PGSCAN_KSWAPD ),FOR_ALL_ZONES (PGSCAN_DIRECT ), #ifdef CONFIG_NUMAPGSCAN_ZONE_RECLAIM_FAILED , #endif -PGINODESTEAL ,SLABS_SCANNED ,KSWAPD_STEAL ,KSWAPD_INODESTEAL , +PGINODESTEAL ,SLABS_SCANNED ,KSWAPD_INODESTEAL ,KSWAPD_LOW_WMARK_HIT_QUICKLY ,KSWAPD_HIGH_WMARK_HIT_QUICKLY ,KSWAPD_SKIP_CONGESTION_WAIT , PAGEOUTRUN, ALLOCSTALL, PGROTATED,
mm/vmscan.c +8 -3
@@ -1568,9 +1568,14 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz, reclaim_stat->recent_scanned[0 ] += nr_anon; reclaim_stat->recent_scanned[1 ] += nr_file; -if (current_is_kswapd ()) -__count_vm_events (KSWAPD_STEAL , nr_reclaimed); -__count_zone_vm_events (PGSTEAL , zone, nr_reclaimed); +if (global_reclaim (sc)) { +if (current_is_kswapd ()) +__count_zone_vm_events (PGSTEAL_KSWAPD , zone, + nr_reclaimed); +else +__count_zone_vm_events (PGSTEAL_DIRECT , zone, + nr_reclaimed); + }putback_inactive_pages (mz, &page_list);
mm/vmstat.c +2 -2
@@ -738,7 +738,8 @@ const char * const vmstat_text[] = {"pgmajfault" , TEXTS_FOR_ZONES("pgrefill") - TEXTS_FOR_ZONES("pgsteal") + TEXTS_FOR_ZONES("pgsteal_kswapd") + TEXTS_FOR_ZONES("pgsteal_direct") TEXTS_FOR_ZONES("pgscan_kswapd")TEXTS_FOR_ZONES ("pgscan_direct" )
@@ -747,7 +748,6 @@ const char * const vmstat_text[] = {#endif "pginodesteal" ,"slabs_scanned" , -"kswapd_steal" ,"kswapd_inodesteal" ,"kswapd_low_wmark_hit_quickly" , "kswapd_high_wmark_hit_quickly",
Signature · 8 lines
1.7.7.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Sorry for the spam, please ignore... I hit the wrong button.
--Ying
Quoted 87 lines · Ying Han
It is always confusing on stat "pgsteal" where it counts both direct reclaim as well as background reclaim. However, we have "
kswapd_steal" which also counts background reclaim value.This patch fixes it and also makes it match the existng "
pgscan_" stats.Test:
pgsteal_kswapd_dma32447623pgsteal_kswapd_normal42272677pgsteal_kswapd_movable0pgsteal_direct_dma322801pgsteal_direct_normal44353270pgsteal_direct_movable0Signed-off-by Ying Han <[email protected]>---
include/linux/vm_event_item.h | 5 +++--
mm/vmscan.c | 11 ++++++++---
mm/vmstat.c | 4 ++--3 files changed, 13 insertions(+), 7 deletions(-)include/linux/vm_event_item.h +3
-2@@ -26,13 +26,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGFREE, PGACTIVATE, PGDEACTIVATE, PGFAULT, PGMAJFAULT, FOR_ALL_ZONES(PGREFILL), - FOR_ALL_ZONES(PGSTEAL), + FOR_ALL_ZONES(PGSTEAL_KSWAPD), + FOR_ALL_ZONES(PGSTEAL_DIRECT), FOR_ALL_ZONES(PGSCAN_KSWAPD), FOR_ALL_ZONES(PGSCAN_DIRECT), #ifdef CONFIG_NUMA PGSCAN_ZONE_RECLAIM_FAILED, #endif - PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, + PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, KSWAPD_SKIP_CONGESTION_WAIT, PAGEOUTRUN, ALLOCSTALL, PGROTATED,mm/vmscan.c +8
-3@@ -1568,9 +1568,14 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz, reclaim_stat->recent_scanned[0] += nr_anon; reclaim_stat->recent_scanned[1] += nr_file; - if (current_is_kswapd()) - __count_vm_events(KSWAPD_STEAL, nr_reclaimed); - __count_zone_vm_events(PGSTEAL, zone, nr_reclaimed); + if (global_reclaim(sc)) { + if (current_is_kswapd()) + __count_zone_vm_events(PGSTEAL_KSWAPD, zone, + nr_reclaimed); + else + __count_zone_vm_events(PGSTEAL_DIRECT, zone, + nr_reclaimed); + } putback_inactive_pages(mz, &page_list);mm/vmstat.c +2
-3@@ -738,7 +738,8 @@ const char * const vmstat_text[] = { "pgmajfault", TEXTS_FOR_ZONES("pgrefill") - TEXTS_FOR_ZONES("pgsteal") + TEXTS_FOR_ZONES("pgsteal_kswapd") + TEXTS_FOR_ZONES("pgsteal_direct") TEXTS_FOR_ZONES("pgscan_kswapd") TEXTS_FOR_ZONES("pgscan_direct")@@ -747,7 +748,6 @@ const char * const vmstat_text[] = { #endif "pginodesteal", "slabs_scanned", - "kswapd_steal", "kswapd_inodesteal", "kswapd_low_wmark_hit_quickly", "kswapd_high_wmark_hit_quickly", --
Quoted 2 lines
1.7.7.3
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>