Subject: Re: kern/25279: NFS read doesn't update atime
To: None <wrstuden@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 06/28/2005 10:35:55
> > > > however, i still don't like the idea to update atime in VOP_GETPAGES.
> > > > it sounds like "update randomly" to me.
> > > > if we want to update atime for mmap, i prefer to do it when a file is mmap'ed.
> > > 
> > > Why? Isn't mtime the time of last modification? Thus shouldn't it be 
> > > noted?
> > 
> > you are confused between atime and mtime.
> 
> Yes, I was. But s/mtime/atime/ and /modification/accessed/ and it's the 
> same comment. I don't see how the fact we are using mmap really changes 
> the need for retaining the info; we are doing things to the file that the 
> description of these fields indicates we should note.

it's too expensive and unreasonable to detect every actual read of
memory for atime update.

if you consider mmap for read as a lazy implementation of read(2),
it's appropriate to note it at mmap time.

> I realize we are being a bit fuzzy with things in that we do the updates 
> in GETPAGES(). If I'm understanding how this works, if a page is resident 
> and never gets pushed out, a process could keep using a page and we won't 
> see subsequent updates to atime (or mtime). But I think what we're doing 
> is better than just noting at mmap time.

it's what i called "randomly".

talking about mtime, i think it can be noted when the changes are
flushed out to backing store.  ie. when we usually notice the dirtiness
of the pages.
updating mtime in VOP_GETPAGES is somewhat improper, IMO.

YAMAMOTO Takashi