]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] vm: add per-zone writeout counter
authorAndrew Morton <akpm@osdl.org>
Wed, 27 Sep 2006 08:50:00 +0000 (01:50 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Sep 2006 15:26:12 +0000 (08:26 -0700)
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 `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 <clameter@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/mmzone.h
mm/vmscan.c
mm/vmstat.c

index 7fa1cbe9fa7aac46d3f82929065479449dc42f66..1b0680cd84d2f04abd3352a58ca695cc3e3aeec4 100644 (file)
@@ -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 */
index 87779dda4ec6d7af4afe8427c6cf0476138d3245..87d340999ce8a5d8ada08487627769bb0574381f 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/vmstat.h>
 #include <linux/file.h>
 #include <linux/writeback.h>
 #include <linux/blkdev.h>
@@ -370,7 +371,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping)
                        /* synchronous write or broken a_ops? */
                        ClearPageReclaim(page);
                }
-
+               inc_zone_page_state(page, NR_VMSCAN_WRITE);
                return PAGE_SUCCESS;
        }
 
index 490d8c1a0ded5efe731e6729136e3460341b3e5e..69c657132e1f79ecebbd590883d1470d5e781ba1 100644 (file)
@@ -465,6 +465,7 @@ static char *vmstat_text[] = {
        "nr_writeback",
        "nr_unstable",
        "nr_bounce",
+       "nr_vmscan_write",
 
 #ifdef CONFIG_NUMA
        "numa_hit",