From: Jan Kara <jack@suse.cz>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
Linux Filesystem Development List <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/5] vfs: use writeback lists to provide lazytime one day timeout
Date: Fri, 28 Nov 2014 18:20:46 +0100 [thread overview]
Message-ID: <20141128172046.GC738@quack.suse.cz> (raw)
In-Reply-To: <1417154411-5367-4-git-send-email-tytso@mit.edu>
On Fri 28-11-14 01:00:08, Ted Tso wrote:
> Queue inodes with dirty timestamps for writeback 24 hours after they
> were initially dirtied.
Oh I see, this patch should probably replace the other 2/5 patch.
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> fs/fs-writeback.c | 29 +++++++++++++++++++++++------
> 1 file changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 3d562e2..bd76590 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -253,7 +253,7 @@ static bool inode_dirtied_after(struct inode *inode, unsigned long t)
> */
> static int move_expired_inodes(struct list_head *delaying_queue,
> struct list_head *dispatch_queue,
> - struct wb_writeback_work *work)
> + unsigned long *older_than_this)
> {
> LIST_HEAD(tmp);
> struct list_head *pos, *node;
> @@ -264,8 +264,8 @@ static int move_expired_inodes(struct list_head *delaying_queue,
>
> while (!list_empty(delaying_queue)) {
> inode = wb_inode(delaying_queue->prev);
> - if (work->older_than_this &&
> - inode_dirtied_after(inode, *work->older_than_this))
> + if (older_than_this &&
> + inode_dirtied_after(inode, *older_than_this))
> break;
> list_move(&inode->i_wb_list, &tmp);
> moved++;
> @@ -309,9 +309,14 @@ out:
> static void queue_io(struct bdi_writeback *wb, struct wb_writeback_work *work)
> {
> int moved;
> + unsigned long one_day_later = jiffies + (HZ * 86400);
> +
> assert_spin_locked(&wb->list_lock);
> list_splice_init(&wb->b_more_io, &wb->b_io);
> - moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, work);
> + moved = move_expired_inodes(&wb->b_dirty, &wb->b_io,
> + work->older_than_this);
> + moved += move_expired_inodes(&wb->b_dirty_time, &wb->b_io,
> + &one_day_later);
I'd change this to:
if (work->sync_mode == WB_SYNC_ALL) {
moved += move_expired_inodes(&wb->b_dirty_time, &wb->b_io,
work->older_than_this);
} else {
moved += move_expired_inodes(&wb->b_dirty_time, &wb->b_io,
&one_day_later);
}
That way you can get rid of special sync handling. Also just fold this
patch into 1/5...
> trace_writeback_queue_io(wb, work, moved);
> }
>
> @@ -679,6 +684,17 @@ static long writeback_sb_inodes(struct super_block *sb,
> inode->i_state |= I_SYNC;
> spin_unlock(&inode->i_lock);
>
> + /*
> + * If the inode is marked dirty time but is not dirty,
> + * then at last for ext3 and ext4 we need to call
> + * mark_inode_dirty_sync in order to get the inode
> + * timestamp transferred to the on disk inode, since
> + * write_inode is a no-op for those file systems.
> + */
> + if ((inode->i_state & I_DIRTY_TIME) &&
> + ((inode->i_state & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) == 0))
> + mark_inode_dirty_sync(inode);
> +
This isn't necessary - you already handle this in
__writeback_single_inode(). Or am I missing something?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-11-28 17:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 6:00 [PATCH-v5 0/5] add support for a lazytime mount option Theodore Ts'o
2014-11-28 6:00 ` [PATCH-v5 1/5] vfs: " Theodore Ts'o
2014-11-28 17:23 ` Jan Kara
[not found] ` <20141128181421.GA19461@google.com>
2014-12-02 12:58 ` Jan Kara
2014-12-02 17:55 ` Boaz Harrosh
2014-12-02 19:23 ` Theodore Ts'o
2014-12-02 20:37 ` Andreas Dilger
2014-12-02 21:01 ` Theodore Ts'o
2014-11-28 6:00 ` [PATCH-v5 2/5] vfs: don't let the dirty time inodes get more than a day stale Theodore Ts'o
2014-11-28 16:43 ` Jan Kara
2014-11-28 6:00 ` [PATCH 2/5] vfs: use writeback lists to provide lazytime one day timeout Theodore Ts'o
2014-11-28 17:20 ` Jan Kara [this message]
2014-11-28 6:00 ` [PATCH-v5 3/5] vfs: add lazytime tracepoints for better debugging Theodore Ts'o
2014-11-28 6:00 ` [PATCH-v5 4/5] vfs: add find_inode_nowait() function Theodore Ts'o
2014-11-28 6:00 ` [PATCH-v5 5/5] ext4: add optimization for the lazytime mount option Theodore Ts'o
2014-11-28 8:55 ` [PATCH-v5 0/5] add support for a " Sedat Dilek
2014-11-28 15:07 ` Theodore Ts'o
2014-11-28 16:32 ` Jan Kara
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=20141128172046.GC738@quack.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).