[Top] [All Lists]

Re: [PATCH 2/4] vfs: add support for a lazytime mount option

To: Jan Kara <jack@xxxxxxx>
Subject: Re: [PATCH 2/4] vfs: add support for a lazytime mount option
From: Theodore Ts'o <tytso@xxxxxxx>
Date: Tue, 25 Nov 2014 12:57:16 -0500
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, Ext4 Developers List <linux-ext4@xxxxxxxxxxxxxxx>, linux-btrfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=MXj4V0Xjp6O988CMYcud/EI2V1bPlblG69Pt7rCdalc=; b=haQlGvjgKC6YdmoGQsk2BI4VMbV6x1CUgxhIhZlm415RJhONGpcGyNZvuo95UcJJpOHWpjrrt/Rd6IZcKKd3CPC8qJEdBIEEAiYK3lb3qKTJ3jpB78jAU9AZskqWX+33eZ/dn6YirGNCOJbL8I3tOFol5efZ/9eNfE4ZVm0jf/Q=;
In-reply-to: <20141125171927.GC3228@xxxxxxxxxxxxx>
References: <1416599964-21892-1-git-send-email-tytso@xxxxxxx> <1416599964-21892-3-git-send-email-tytso@xxxxxxx> <20141125015239.GD27262@dastard> <20141125043335.GF31339@xxxxxxxxx> <20141125171927.GC3228@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Tue, Nov 25, 2014 at 06:19:27PM +0100, Jan Kara wrote:
>   Actually, I'd also prefer to do the writing from iput_final(). My main
> reason is that shrinker starts behaving very differently when you put
> inodes with I_DIRTY_TIME to the LRU. See inode_lru_isolate() and in
> particular:
>         /*
>          * Referenced or dirty inodes are still in use. Give them another
>          * pass
>          * through the LRU as we canot reclaim them now.
>          */
>         if (atomic_read(&inode->i_count) ||
>             (inode->i_state & ~I_REFERENCED)) {
>                 list_del_init(&inode->i_lru);
>                 spin_unlock(&inode->i_lock);
>                 this_cpu_dec(nr_unused);
>                 return LRU_REMOVED;
>         }

I must be missing something; how would the shirnker behave
differently?  I_DIRTY_TIME shouldn't have any effect on the shrinker;
note that I_DIRTY_TIME is *not* part of I_DIRTY, and this was quite
deliberate, because I didn't want I_DIRTY_TIME to have any affect on
any of the other parts of the writeback or inode management parts.

> Regarding your concern that we'd write the inode when file is closed -
> that's not true. We'll write the inode only after corresponding dentry is
> evicted and thus drops inode reference. That doesn't seem too bad to me.

True, fair enough.  It's not quite so lazy, but it should be close

I'm still not seeing the benefit in waiting until the last possible
minute to write out the timestamps; evict() can block as it is if
there are any writeback that needs to be completed, and if the
writeback happens to pages subject to delalloc, the timestamp update
could happen for free at that point.

                                                - Ted

<Prev in Thread] Current Thread [Next in Thread>