public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, Ted Tso <tytso@mit.edu>,
	Martijn Coenen <maco@android.com>,
	tj@kernel.org
Subject: Re: [PATCH 3/3] writeback: Drop I_DIRTY_TIME_EXPIRE
Date: Wed, 10 Jun 2020 08:11:41 -0700	[thread overview]
Message-ID: <20200610151141.GC21733@infradead.org> (raw)
In-Reply-To: <20200601091904.4786-3-jack@suse.cz>

On Mon, Jun 01, 2020 at 11:18:57AM +0200, Jan Kara wrote:
> The only use of I_DIRTY_TIME_EXPIRE is to detect in
> __writeback_single_inode() that inode got there because flush worker
> decided it's time to writeback the dirty inode time stamps (either
> because we are syncing or because of age). However we can detect this
> directly in __writeback_single_inode() and there's no need for the
> strange propagation with I_DIRTY_TIME_EXPIRE flag.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

One nit below:

>  	if (inode->i_state & I_DIRTY_TIME) {
>  		if ((dirty & I_DIRTY_INODE) ||
> -		    wbc->sync_mode == WB_SYNC_ALL ||
> -		    unlikely(inode->i_state & I_DIRTY_TIME_EXPIRED) ||
> +		    wbc->sync_mode == WB_SYNC_ALL || wbc->for_sync ||
>  		    unlikely(time_after(jiffies,
>  					(inode->dirtied_time_when +
>  					 dirtytime_expire_interval * HZ)))) {
> -			dirty |= I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED;
> +			dirty |= I_DIRTY_TIME;
>  			trace_writeback_lazytime(inode);
>  		}
> -	} else
> -		inode->i_state &= ~I_DIRTY_TIME_EXPIRED;
> +	}

We can also drop some indentation here.  And remove the totally silly
unlikely, something like:

	if ((inode->i_state & I_DIRTY_TIME) &&
	    ((dirty & I_DIRTY_INODE) ||
	     wbc->sync_mode == WB_SYNC_ALL || wbc->for_sync ||
	     time_after(jiffies, inode->dirtied_time_when +
			dirtytime_expire_interval * HZ)))) {
		dirty |= I_DIRTY_TIME;
		trace_writeback_lazytime(inode);
	}

  reply	other threads:[~2020-06-10 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  9:18 [PATCH 0/3] writeback: Lazytime handling fix and cleanups Jan Kara
2020-06-01  9:18 ` [PATCH 1/3] writeback: Avoid skipping inode writeback Jan Kara
2020-06-05 14:11   ` Sasha Levin
2020-06-10 15:02   ` Christoph Hellwig
2020-06-10 15:30     ` Jan Kara
2020-06-01  9:18 ` [PATCH 2/3] writeback: Fix sync livelock due to b_dirty_time processing Jan Kara
2020-06-10 15:06   ` Christoph Hellwig
2020-06-10 15:54     ` Jan Kara
2020-06-10 15:58       ` Christoph Hellwig
2020-06-01  9:18 ` [PATCH 3/3] writeback: Drop I_DIRTY_TIME_EXPIRE Jan Kara
2020-06-10 15:11   ` Christoph Hellwig [this message]
2020-06-10 16:20     ` Jan Kara
2020-06-10 10:04 ` [PATCH 0/3] writeback: Lazytime handling fix and cleanups 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=20200610151141.GC21733@infradead.org \
    --to=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=tj@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