Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Miklos Szeredi and committed by
Linus Torvalds
fc3ba692 dd5656e5

+8 -1
+2
drivers/base/node.c
··· 77 77 "Node %d PageTables: %8lu kB\n" 78 78 "Node %d NFS_Unstable: %8lu kB\n" 79 79 "Node %d Bounce: %8lu kB\n" 80 + "Node %d WritebackTmp: %8lu kB\n" 80 81 "Node %d Slab: %8lu kB\n" 81 82 "Node %d SReclaimable: %8lu kB\n" 82 83 "Node %d SUnreclaim: %8lu kB\n", ··· 100 99 nid, K(node_page_state(nid, NR_PAGETABLE)), 101 100 nid, K(node_page_state(nid, NR_UNSTABLE_NFS)), 102 101 nid, K(node_page_state(nid, NR_BOUNCE)), 102 + nid, K(node_page_state(nid, NR_WRITEBACK_TEMP)), 103 103 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) + 104 104 node_page_state(nid, NR_SLAB_UNRECLAIMABLE)), 105 105 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
+2
fs/proc/proc_misc.c
··· 179 179 "PageTables: %8lu kB\n" 180 180 "NFS_Unstable: %8lu kB\n" 181 181 "Bounce: %8lu kB\n" 182 + "WritebackTmp: %8lu kB\n" 182 183 "CommitLimit: %8lu kB\n" 183 184 "Committed_AS: %8lu kB\n" 184 185 "VmallocTotal: %8lu kB\n" ··· 211 210 K(global_page_state(NR_PAGETABLE)), 212 211 K(global_page_state(NR_UNSTABLE_NFS)), 213 212 K(global_page_state(NR_BOUNCE)), 213 + K(global_page_state(NR_WRITEBACK_TEMP)), 214 214 K(allowed), 215 215 K(committed), 216 216 (unsigned long)VMALLOC_TOTAL >> 10,
+1
include/linux/mmzone.h
··· 97 97 NR_UNSTABLE_NFS, /* NFS unstable pages */ 98 98 NR_BOUNCE, 99 99 NR_VMSCAN_WRITE, 100 + NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ 100 101 #ifdef CONFIG_NUMA 101 102 NUMA_HIT, /* allocated in intended node */ 102 103 NUMA_MISS, /* allocated in non intended node */
+2 -1
mm/page-writeback.c
··· 211 211 avail_dirty = dirty - 212 212 (global_page_state(NR_FILE_DIRTY) + 213 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 217 if (avail_dirty < 0) 217 218 avail_dirty = 0;
+1
mm/vmstat.c
··· 612 612 "nr_unstable", 613 613 "nr_bounce", 614 614 "nr_vmscan_write", 615 + "nr_writeback_temp", 615 616 616 617 #ifdef CONFIG_NUMA 617 618 "numa_hit",