linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Linux Filesystem Development List <linux-fsdevel@vger.kernel.org>,
	jack@suse.cz, torvalds@linux-foundation.org,
	viro@zeniv.linux.org.uk, stable@vger.kernel.org
Subject: Re: [PATCH-v2 1/2] fs: make sure the timestamps for lazytime inodes eventually get written
Date: Tue, 17 Mar 2015 11:29:22 +0100	[thread overview]
Message-ID: <20150317102922.GC23155@quack.suse.cz> (raw)
In-Reply-To: <1426533260-3305-2-git-send-email-tytso@mit.edu>

On Mon 16-03-15 15:14:19, Ted Tso wrote:
> Jan Kara pointed out that if there is an inode which is constantly
> getting dirtied with I_DIRTY_PAGES, an inode with an updated timestamp
> will never be written since inode->dirtied_when is constantly getting
> updated.  We fix this by adding an extra field to the inode,
> dirtied_time_when, so inodes with a stale dirtytime can get detected
> and handled.
> 
> In addition, if we have a dirtytime inode caused by an atime update,
> and there is no write activity on the file system, we need to have a
> secondary system to make sure these inodes get written out.  We do
> this by setting up a second delayed work structure which wakes up the
> CPU much more rarely compared to writeback_expire_centisecs.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Cc: stable@vger.kernel.org
  Since this was merged in rc1, I don't think CC to stable is needed.

> @@ -505,12 +518,17 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
>  	spin_lock(&inode->i_lock);
>  
>  	dirty = inode->i_state & I_DIRTY;
> -	if (((dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) &&
> -	     (inode->i_state & I_DIRTY_TIME)) ||
> -	    (inode->i_state & I_DIRTY_TIME_EXPIRED)) {
> -		dirty |= I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED;
> -		trace_writeback_lazytime(inode);
> -	}
> +	if (inode->i_state & I_DIRTY_TIME) {
> +		if ((dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) ||
> +		    unlikely(inode->i_state & I_DIRTY_TIME_EXPIRED) ||
> +		    unlikely(time_after((inode->dirtied_time_when +
> +					 dirtytime_expire_interval * HZ),
> +					jiffies))) {
  The time comparison is the other way around, isn't it? After fixing that
feel free to add:
  Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  parent reply	other threads:[~2015-03-17 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 19:14 [PATCH-v2 0/2] lazytime bug fixes for 4.0 Theodore Ts'o
2015-03-16 19:14 ` [PATCH-v2 1/2] fs: make sure the timestamps for lazytime inodes eventually get written Theodore Ts'o
2015-03-16 21:34   ` Andreas Dilger
2015-03-17 10:33     ` Jan Kara
2015-03-17 15:53       ` Theodore Ts'o
2015-03-17 15:09     ` Theodore Ts'o
2015-03-17 10:29   ` Jan Kara [this message]
2015-03-16 19:14 ` [PATCH-v2 2/2] fs: add dirtytime_expire_seconds sysctl Theodore Ts'o
2015-03-17 10:30   ` 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=20150317102922.GC23155@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).