From: Andrew Morton The VM is supposed to minimise the number of pages which get written off the LRU (for IO scheduling efficiency, and for high reclaim-success rates). But we don't actually have a clear way of showing how true this is. So add the nr_vmscan_write to /proc/vmstat and /proc/zoneinfo - the number of pages which have been written by the vm scanner in this zone and globally. Cc: Christoph Lameter Signed-off-by: Andrew Morton --- include/linux/mmzone.h | 1 + mm/vmscan.c | 3 ++- mm/vmstat.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff -puN include/linux/mmzone.h~vm-add-per-zone-writeout-counter include/linux/mmzone.h --- a/include/linux/mmzone.h~vm-add-per-zone-writeout-counter +++ a/include/linux/mmzone.h @@ -58,6 +58,7 @@ enum zone_stat_item { NR_WRITEBACK, NR_UNSTABLE_NFS, /* NFS unstable pages */ NR_BOUNCE, + NR_VMSCAN_WRITE, #ifdef CONFIG_NUMA NUMA_HIT, /* allocated in intended node */ NUMA_MISS, /* allocated in non intended node */ diff -puN mm/vmscan.c~vm-add-per-zone-writeout-counter mm/vmscan.c --- a/mm/vmscan.c~vm-add-per-zone-writeout-counter +++ a/mm/vmscan.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -370,7 +371,7 @@ static pageout_t pageout(struct page *pa /* synchronous write or broken a_ops? */ ClearPageReclaim(page); } - + inc_zone_page_state(page, NR_VMSCAN_WRITE); return PAGE_SUCCESS; } diff -puN mm/vmstat.c~vm-add-per-zone-writeout-counter mm/vmstat.c --- a/mm/vmstat.c~vm-add-per-zone-writeout-counter +++ a/mm/vmstat.c @@ -465,6 +465,7 @@ static char *vmstat_text[] = { "nr_writeback", "nr_unstable", "nr_bounce", + "nr_vmscan_write", #ifdef CONFIG_NUMA "numa_hit", _