From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: with ECARTIS (v1.0.0; list xfs); Thu, 18 Oct 2007 00:56:28 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.10/SuSE Linux 0.7) with SMTP id l9I7uIKv012822 for ; Thu, 18 Oct 2007 00:56:22 -0700 Message-ID: <471712C8.4050805@sgi.com> Date: Thu, 18 Oct 2007 18:01:12 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com MIME-Version: 1.0 Subject: Re: [PATCH] flush inode when changing atime. References: <200710170456.AA06101@TNESG9305.wm.jp.nec.com> <20071017090844.GZ995458@sgi.com> <4716D891.1060108@sgi.com> <20071018041736.GA66820511@sgi.com> In-Reply-To: <20071018041736.GA66820511@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com List-Id: xfs To: David Chinner Cc: Utako Kusaka , xfs@oss.sgi.com David Chinner wrote: > On Thu, Oct 18, 2007 at 01:52:49PM +1000, Lachlan McIlroy wrote: >> David Chinner wrote: >>> On Wed, Oct 17, 2007 at 01:56:00PM +0900, Utako Kusaka wrote: >>>> Hi, >>>> >>>> The atime is changed for reading but it returns to a previous value >>>> after unmount. i_update_core is still off after reading a file using >>>> read(), readdir() and readlink(). So an inode isn't flushed to disk. >>> I think this was done by design - Christoph? I can't remember exactly >>> as it was more than two years ago this change was made. It is effectively >>> equivalent to using the relatime mount option. >>> >>> The question is whether we want to change the default behaviour or >>> whether we need to supply an "atimeisatime" mount option for those >>> that really need atime to be updated on every access. >>> >> If we change it back then will anything that scans the filesystem cause >> inodes to be dirtied and create a lot of inode flush traffic that we >> don't currently have? > > Right. And given that it's taken over 2 years for anyone to notice > that atime only get updated when a file is otherwise dirtied.... > >>> If we are going to put these back in, then they should be >>> calls to xfs_ichgtime_fast() so that we know what the reason >>> for marking the core dirty is. >> xfs_ichgtime_fast() will also dirty the linux inode so that sync >> will push out the change. > > The VFS already calls filp_accessed, which marks the linux inode > dirty. We're telling sync that the inode really isn't dirty when > it tries to flush it, so it's not going to disk.... Ah, so it is. We could compare the linux inode atime with the xfs inode atime in the inode flush path and if they are different sync them and dirty the xfs inode (set i_update_core). But as you said it should be a mount option cause flushing inodes just for atime updates would hurt. > > As Christoph pointed out last night to me the problem really is that > VFS atime updates don't have a callback into the filesystem(*) so if > we want to write back atime we've basically got to duplicate VFS > infrastructure. > > (*) i.e. call ->setattr to set the atime. > > Cheers, > > Dave.