Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755921AbYBDOnS (ORCPT ); Mon, 4 Feb 2008 09:43:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756078AbYBDOm2 (ORCPT ); Mon, 4 Feb 2008 09:42:28 -0500 Received: from fxip-0047f.externet.hu ([88.209.222.127]:45238 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756008AbYBDOm0 (ORCPT ); Mon, 4 Feb 2008 09:42:26 -0500 Message-Id: <20080204144206.120192887@szeredi.hu> References: <20080204144142.002127391@szeredi.hu> User-Agent: quilt/0.45-1 Date: Mon, 04 Feb 2008 15:41:44 +0100 From: Miklos Szeredi To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [patch 2/3] mm: Add NR_WRITEBACK_TEMP counter Content-Disposition: inline; filename=add_nr_writeback_temp_stat.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3841 Lines: 90 From: Miklos Szeredi 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 --- Index: linux/fs/proc/proc_misc.c =================================================================== --- linux.orig/fs/proc/proc_misc.c 2008-02-04 12:29:00.000000000 +0100 +++ linux/fs/proc/proc_misc.c 2008-02-04 13:01:35.000000000 +0100 @@ -178,6 +178,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" @@ -209,6 +210,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-02-04 12:29:01.000000000 +0100 +++ linux/include/linux/mmzone.h 2008-02-04 13:01:35.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-02-04 12:28:53.000000000 +0100 +++ linux/drivers/base/node.c 2008-02-04 13:01:35.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-02-04 13:01:23.000000000 +0100 +++ linux/mm/page-writeback.c 2008-02-04 13:01:35.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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/