From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH 27/45] writeback: introduce wbc.for_background Date: Wed, 07 Oct 2009 15:38:45 +0800 Message-ID: <20091007074904.594171831@intel.com> References: <20091007073818.318088777@intel.com> Cc: Theodore Tso , Christoph Hellwig , Dave Chinner , Chris Mason , Peter Zijlstra , "Li Shaohua" , "Myklebust Trond" , "jens.axboe@oracle.com" , Jan Kara , Nick Piggin , , Wu Fengguang To: Andrew Morton Return-path: Cc: LKML Content-Disposition: inline; filename=writeback-add-wbc-for_background.patch Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org It will be tested for setting wbc.nr_segments, lower the flush priority for NFS, and maybe more in future. Signed-off-by: Wu Fengguang --- fs/fs-writeback.c | 1 + fs/nfs/write.c | 2 +- include/linux/writeback.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) --- linux.orig/fs/fs-writeback.c 2009-10-06 23:38:56.000000000 +0800 +++ linux/fs/fs-writeback.c 2009-10-06 23:39:27.000000000 +0800 @@ -783,6 +783,7 @@ static long wb_writeback(struct bdi_writ .sync_mode = args->sync_mode, .older_than_this = NULL, .for_kupdate = args->for_kupdate, + .for_background = args->for_background, .range_cyclic = args->range_cyclic, }; unsigned long oldest_jif; --- linux.orig/include/linux/writeback.h 2009-10-06 23:38:52.000000000 +0800 +++ linux/include/linux/writeback.h 2009-10-06 23:39:27.000000000 +0800 @@ -61,6 +61,7 @@ struct writeback_control { unsigned nonblocking:1; /* Don't get stuck on request queues */ unsigned encountered_congestion:1; /* An output: a queue is full */ unsigned for_kupdate:1; /* A kupdate writeback */ + unsigned for_background:1; /* A background writeback */ unsigned for_reclaim:1; /* Invoked from the page allocator */ unsigned range_cyclic:1; /* range_start is cyclic */ unsigned more_io:1; /* more io to be dispatched */ --- linux.orig/fs/nfs/write.c 2009-10-06 23:38:44.000000000 +0800 +++ linux/fs/nfs/write.c 2009-10-06 23:39:27.000000000 +0800 @@ -178,7 +178,7 @@ static int wb_priority(struct writeback_ { if (wbc->for_reclaim) return FLUSH_HIGHPRI | FLUSH_STABLE; - if (wbc->for_kupdate) + if (wbc->for_kupdate || wbc->for_background) return FLUSH_LOWPRI; return 0; }