aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-04-30 03:54:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:50 -0400
commitfc3ba692a4d19019387c5acaea63131f9eab05dd (patch)
treec86e025cb8f79c7ffc479029989b7378bcb9f285
parentdd5656e59ca7b25fb60a22f9079905ed0da5ed0c (diff)
mm: Add NR_WRITEBACK_TEMP counter
Fuse will use temporary buffers to write back dirty data from memory mappings (normal writes are done synchronously). This is needed, because there cannot be any guarantee about the time in which a write will complete. By using temporary buffers, from the MM's point if view the page is written back immediately. If the writeout was due to memory pressure, this effectively migrates data from a full zone to a less full zone. This patch adds a new counter (NR_WRITEBACK_TEMP) for the number of pages used as temporary buffers. [Lee.Schermerhorn@hp.com: add vmstat_text for NR_WRITEBACK_TEMP] Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/base/node.c2
-rw-r--r--fs/proc/proc_misc.c2
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--mm/page-writeback.c3
-rw-r--r--mm/vmstat.c1
5 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 12fde2d03d69..39f3d1b3a213 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -77,6 +77,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
77 "Node %d PageTables: %8lu kB\n" 77 "Node %d PageTables: %8lu kB\n"
78 "Node %d NFS_Unstable: %8lu kB\n" 78 "Node %d NFS_Unstable: %8lu kB\n"
79 "Node %d Bounce: %8lu kB\n" 79 "Node %d Bounce: %8lu kB\n"
80 "Node %d WritebackTmp: %8lu kB\n"
80 "Node %d Slab: %8lu kB\n" 81 "Node %d Slab: %8lu kB\n"
81 "Node %d SReclaimable: %8lu kB\n" 82 "Node %d SReclaimable: %8lu kB\n"
82 "Node %d SUnreclaim: %8lu kB\n", 83 "Node %d SUnreclaim: %8lu kB\n",
@@ -99,6 +100,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
99 nid, K(node_page_state(nid, NR_PAGETABLE)), 100 nid, K(node_page_state(nid, NR_PAGETABLE)),
100 nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), 101 nid, K(node_page_state(nid, NR_UNSTABLE_NFS)),
101 nid, K(node_page_state(nid, NR_BOUNCE)), 102 nid, K(node_page_state(nid, NR_BOUNCE)),
103 nid, K(node_page_state(nid, NR_WRITEBACK_TEMP)),
102 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) + 104 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
103 node_page_state(nid, NR_SLAB_UNRECLAIMABLE)), 105 node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
104 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)), 106 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 48bcf20cec2f..74a323d2b850 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -179,6 +179,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
179 "PageTables: %8lu kB\n" 179 "PageTables: %8lu kB\n"
180 "NFS_Unstable: %8lu kB\n" 180 "NFS_Unstable: %8lu kB\n"
181 "Bounce: %8lu kB\n" 181 "Bounce: %8lu kB\n"
182 "WritebackTmp: %8lu kB\n"
182 "CommitLimit: %8lu kB\n" 183 "CommitLimit: %8lu kB\n"
183 "Committed_AS: %8lu kB\n" 184 "Committed_AS: %8lu kB\n"
184 "VmallocTotal: %8lu kB\n" 185 "VmallocTotal: %8lu kB\n"
@@ -210,6 +211,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
210 K(global_page_state(NR_PAGETABLE)), 211 K(global_page_state(NR_PAGETABLE)),
211 K(global_page_state(NR_UNSTABLE_NFS)), 212 K(global_page_state(NR_UNSTABLE_NFS)),
212 K(global_page_state(NR_BOUNCE)), 213 K(global_page_state(NR_BOUNCE)),
214 K(global_page_state(NR_WRITEBACK_TEMP)),
213 K(allowed), 215 K(allowed),
214 K(committed), 216 K(committed),
215 (unsigned long)VMALLOC_TOTAL >> 10, 217 (unsigned long)VMALLOC_TOTAL >> 10,
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index aad98003176f..ceb675d83a56 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -97,6 +97,7 @@ enum zone_stat_item {
97 NR_UNSTABLE_NFS, /* NFS unstable pages */ 97 NR_UNSTABLE_NFS, /* NFS unstable pages */
98 NR_BOUNCE, 98 NR_BOUNCE,
99 NR_VMSCAN_WRITE, 99 NR_VMSCAN_WRITE,
100 NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */
100#ifdef CONFIG_NUMA 101#ifdef CONFIG_NUMA
101 NUMA_HIT, /* allocated in intended node */ 102 NUMA_HIT, /* allocated in intended node */
102 NUMA_MISS, /* allocated in non intended node */ 103 NUMA_MISS, /* allocated in non intended node */
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index c90a1e8e479f..789b6adbef37 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -211,7 +211,8 @@ clip_bdi_dirty_limit(struct backing_dev_info *bdi, long dirty, long *pbdi_dirty)
211 avail_dirty = dirty - 211 avail_dirty = dirty -
212 (global_page_state(NR_FILE_DIRTY) + 212 (global_page_state(NR_FILE_DIRTY) +
213 global_page_state(NR_WRITEBACK) + 213 global_page_state(NR_WRITEBACK) +
214 global_page_state(NR_UNSTABLE_NFS)); 214 global_page_state(NR_UNSTABLE_NFS) +
215 global_page_state(NR_WRITEBACK_TEMP));
215 216
216 if (avail_dirty < 0) 217 if (avail_dirty < 0)
217 avail_dirty = 0; 218 avail_dirty = 0;
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 280a7ed549f2..1a32130b958c 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -612,6 +612,7 @@ static const char * const vmstat_text[] = {
612 "nr_unstable", 612 "nr_unstable",
613 "nr_bounce", 613 "nr_bounce",
614 "nr_vmscan_write", 614 "nr_vmscan_write",
615 "nr_writeback_temp",
615 616
616#ifdef CONFIG_NUMA 617#ifdef CONFIG_NUMA
617 "numa_hit", 618 "numa_hit",