linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
From: Miklos Szeredi <mszeredi@suse.cz>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: [patch 2/8] mm: Add NR_WRITEBACK_TEMP counter
Date: Mon, 17 Mar 2008 20:19:10 +0100	[thread overview]
Message-ID: <20080317191942.482475908@szeredi.hu> (raw)
In-Reply-To: <20080317191908.123631326@szeredi.hu>

[-- Attachment #1: add_nr_writeback_temp_stat.patch --]
[-- Type: text/plain, Size: 3966 bytes --]

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.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 drivers/base/node.c    |    2 ++
 fs/proc/proc_misc.c    |    2 ++
 include/linux/mmzone.h |    1 +
 mm/page-writeback.c    |    3 ++-
 4 files changed, 7 insertions(+), 1 deletion(-)

Index: linux/fs/proc/proc_misc.c
===================================================================
--- linux.orig/fs/proc/proc_misc.c	2008-03-17 18:24:13.000000000 +0100
+++ linux/fs/proc/proc_misc.c	2008-03-17 18:25:17.000000000 +0100
@@ -179,6 +179,7 @@ static int meminfo_read_proc(char *page,
 		"PageTables:   %8lu kB\n"
 		"NFS_Unstable: %8lu kB\n"
 		"Bounce:       %8lu kB\n"
+		"WritebackTmp: %8lu kB\n"
 		"CommitLimit:  %8lu kB\n"
 		"Committed_AS: %8lu kB\n"
 		"VmallocTotal: %8lu kB\n"
@@ -210,6 +211,7 @@ static int meminfo_read_proc(char *page,
 		K(global_page_state(NR_PAGETABLE)),
 		K(global_page_state(NR_UNSTABLE_NFS)),
 		K(global_page_state(NR_BOUNCE)),
+		K(global_page_state(NR_WRITEBACK_TEMP)),
 		K(allowed),
 		K(committed),
 		(unsigned long)VMALLOC_TOTAL >> 10,
Index: linux/include/linux/mmzone.h
===================================================================
--- linux.orig/include/linux/mmzone.h	2008-03-17 18:24:13.000000000 +0100
+++ linux/include/linux/mmzone.h	2008-03-17 18:25:17.000000000 +0100
@@ -95,6 +95,7 @@ enum zone_stat_item {
 	NR_UNSTABLE_NFS,	/* NFS unstable pages */
 	NR_BOUNCE,
 	NR_VMSCAN_WRITE,
+	NR_WRITEBACK_TEMP,	/* Writeback using temporary buffers */
 #ifdef CONFIG_NUMA
 	NUMA_HIT,		/* allocated in intended node */
 	NUMA_MISS,		/* allocated in non intended node */
Index: linux/drivers/base/node.c
===================================================================
--- linux.orig/drivers/base/node.c	2008-03-17 18:24:13.000000000 +0100
+++ linux/drivers/base/node.c	2008-03-17 18:25:17.000000000 +0100
@@ -64,6 +64,7 @@ static ssize_t node_read_meminfo(struct 
 		       "Node %d PageTables:   %8lu kB\n"
 		       "Node %d NFS_Unstable: %8lu kB\n"
 		       "Node %d Bounce:       %8lu kB\n"
+		       "Node %d WritebackTmp: %8lu kB\n"
 		       "Node %d Slab:         %8lu kB\n"
 		       "Node %d SReclaimable: %8lu kB\n"
 		       "Node %d SUnreclaim:   %8lu kB\n",
@@ -86,6 +87,7 @@ static ssize_t node_read_meminfo(struct 
 		       nid, K(node_page_state(nid, NR_PAGETABLE)),
 		       nid, K(node_page_state(nid, NR_UNSTABLE_NFS)),
 		       nid, K(node_page_state(nid, NR_BOUNCE)),
+		       nid, K(node_page_state(nid, NR_WRITEBACK_TEMP)),
 		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
 				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
 		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
Index: linux/mm/page-writeback.c
===================================================================
--- linux.orig/mm/page-writeback.c	2008-03-17 18:24:36.000000000 +0100
+++ linux/mm/page-writeback.c	2008-03-17 18:25:17.000000000 +0100
@@ -211,7 +211,8 @@ clip_bdi_dirty_limit(struct backing_dev_
 	avail_dirty = dirty -
 		(global_page_state(NR_FILE_DIRTY) +
 		 global_page_state(NR_WRITEBACK) +
-		 global_page_state(NR_UNSTABLE_NFS));
+		 global_page_state(NR_UNSTABLE_NFS) +
+		 global_page_state(NR_WRITEBACK_TEMP));
 
 	if (avail_dirty < 0)
 		avail_dirty = 0;

--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2008-03-17 19:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 19:19 [patch 0/8] fuse: writable mmap + batched write Miklos Szeredi
2008-03-17 19:19 ` [patch 1/8] mm: bdi: export bdi_writeout_inc() Miklos Szeredi, Miklos Szeredi
2008-03-18 11:27   ` Peter Zijlstra
2008-03-18 11:46     ` Miklos Szeredi
2008-03-17 19:19 ` Miklos Szeredi, Miklos Szeredi [this message]
2008-03-18  5:05   ` [patch 2/8] mm: Add NR_WRITEBACK_TEMP counter Andrew Morton
2008-03-17 19:19 ` [patch 3/8] mm: rotate_reclaimable_page() cleanup Miklos Szeredi, Miklos Szeredi
2008-03-18 11:31   ` Peter Zijlstra
2008-03-18 11:56     ` Miklos Szeredi
2008-03-18 16:45       ` Andrew Morton
2008-03-17 19:19 ` [patch 4/8] mm: allow not updating BDI stats in end_page_writeback() Miklos Szeredi, Miklos Szeredi
2008-03-18  5:04   ` Andrew Morton
2008-03-18  8:11     ` Miklos Szeredi
2008-03-18  8:18       ` Andrew Morton
2008-03-18 11:33   ` Peter Zijlstra
2008-03-18 11:59     ` Miklos Szeredi
2008-03-18 12:29       ` Peter Zijlstra
2008-03-18 12:51         ` Miklos Szeredi
2008-03-18 13:08           ` Peter Zijlstra
2008-03-18 13:58             ` Miklos Szeredi
2008-03-18 13:59               ` Peter Zijlstra
2008-03-18 15:53                 ` Miklos Szeredi
2008-03-18 16:49                   ` Andrew Morton
2008-03-17 19:19 ` [patch 5/8] fuse: support writable mmap Miklos Szeredi, Miklos Szeredi
2008-03-17 19:19 ` [patch 6/8] fuse: clean up setting i_size in write Miklos Szeredi, Miklos Szeredi
2008-03-18  5:08   ` Andrew Morton
2008-03-18  8:16     ` Miklos Szeredi
2008-03-17 19:19 ` [patch 7/8] fuse: implement perform_write Miklos Szeredi, Nick Piggin
2008-03-17 19:19 ` [patch 8/8] fuse: update file size on short read Miklos Szeredi, Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080317191942.482475908@szeredi.hu \
    --to=miklos@szeredi.hu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox