[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100712030129.GA22769@infradead.org>
Date: Sun, 11 Jul 2010 23:01:29 -0400
From: Christoph Hellwig <hch@...radead.org>
To: Wu Fengguang <fengguang.wu@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Theodore Tso <tytso@....edu>,
Christoph Hellwig <hch@...radead.org>,
Dave Chinner <david@...morbit.com>,
Chris Mason <chris.mason@...cle.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Li Shaohua <shaohua.li@...el.com>,
Myklebust Trond <Trond.Myklebust@...app.com>,
"jens.axboe@...cle.com" <jens.axboe@...cle.com>,
Jan Kara <jack@...e.cz>, Nick Piggin <npiggin@...e.de>,
linux-fsdevel@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 31/45] writeback: sync old inodes first in background
writeback
On Wed, Oct 07, 2009 at 03:38:49PM +0800, Wu Fengguang wrote:
> A background flush work may run for ever. So it's reasonable for it to
> mimic the kupdate behavior of syncing old/expired inodes first.
I've looked at this a bit again after you pointed to this thread in
the direct reclaim thread, and I think we should be even more aggressive
in pushing out old inodes.
We basically have two types of I/O done from wb_do_writeback:
- either we want to write all inodes for a given bdi/superblock. That
includes all WB_SYNC_ALL callers, but also things like
writeback_inodes_sb and the wakeup_flusher_threads call from
sys_sync.
- or we have a specific goal, like for the background writeback or
the wakeup_flusher_threads from free_more_memory.
For the first case there's obviously no point in doing any
older_than_this processing as we write out all inodes anyway.
For the second case we should always do a older_than_this pass _first_.
Rationale: we really should get the old inodes out ASAP, so that we
keep the amount of changes lost on a crash in the boundaries.
Furthermore the callers only need N pages cleaned, and they don't care
where from. So if we can reach our goal with the older_than_this
writeback we're fine. If the writeback loop is long enough we can
keep doing more of these later on as well.
Doing this should also help cleaning the code up a bit by moving the
wb_check_old_data_flush logic into wb_writeback and getting rid of the
for_kupdate paramter in struct wb_writeback_work. I'm not even sure
it's worth keeping it in struct writeback_control.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists