[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-nfs
Subject:    Re: [NFS] Filehandle caching ?
From:       Trond Myklebust <trond.myklebust () fys ! uio ! no>
Date:       2000-12-31 15:35:14
[Download RAW message or body]

>>>>> " " == Chetan Ahuja <ahujache@cse.msu.edu> writes:

     > dentry-> fsdata. Is that correct? Does that mean that in 2.2
     > kernels, any dcache hit also means there's a filehandle cached
     > with it?

Yes.

     > Now it seems that 2.4 has moved the filehandle to the inode. Is
     > that correct? And if yes, that should also mean that as long as
     > there's a dcache hit, one should find the filehandle also
     > (since inode cache is controlled by dentry cache).

Yes.

     >  In that case I'm a bit puzzled. Since in the second run of ls
     >  -lR (as
     > mentioned in my previous post), I noticed absolutely no READDIR
     > calls, therefore I assume all directory entries were found in
     > the dcache. And no matter how soon after the first instance of

No. It means that they were found in the page cache. Readdir calls are
cached in the page cache not the dcache.

     > the ls command I run the second instance, there's an exact same
     > number of lookup calls as the first one.

That's because the process of revalidating the dcache involves a
lookup. If you try this on a directory that has not been modified for
a while (mtime > 15 minutes old IIRC) then the cache time will be of
the same order of time as the attribute cache time..

     >   So, I conclude according to my (possibly faulty reasoning)
     >   that even
     > though all the filehandles are cached in memory (through
     > dentry-> d_inode->u.nfs_i.fh which should all be in the cache
     > as dentry lookup was a hit), we are not taking advantage of it
     > at all. Very strange. How is that explained?

Your assumptions are wrong. See above.

     >   I guess I really need to know exactly how that determination
     >   is made
     > (that a given directory changes often). I would really
     > appreciate if somebody would throw some light on that.

        if (!(flags & LOOKUP_CONTINUE)) {
                long diff = CURRENT_TIME - dentry->d_parent->d_inode->i_mtime;

                if (diff < 15*60)
                        timeout = 0;
        }

Cheers,
  Trond

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/nfs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic