[OpenAFS-devel] funny lookup/dnlc/dcache/...

John S. Bucy bucy-openafs-devel@gloop.org
Wed, 20 Apr 2005 15:43:15 -0400


On Tue, Apr 19, 2005 at 10:11:32PM -0400, John S. Bucy wrote:
> On Tue, Apr 19, 2005 at 01:50:43PM -0400, John S. Bucy wrote:
> 
> > It seems like all of the lookups should hit in Linux's dentry cache --
> > they seem to for ext3 -- but AFS is doing a lot of extra work
> > somewhere.  Like many of them are missing and its falling back to
> > afs_dir_Lookup().
> 
> I understand now ... the vfs is doing 
> d_op->d_revalidate = afs_linux_revalidate_dentry(), it falls through the
> dnlc and does an afs_lookup().  It seems like the revalidate routine
> should be able to know whether or not the dir vnode has changed since
> the dentry was last validated and only do the lookup in that case.
> 
> I notice that struct dentry has a void *d_fsdata that AFS isn't using
> right now that might be used to track, say, the data version of the
> dir vnode.

The dnlc is kept up-to-date via callbacks on the directory objects so
a hit in the dnlc can be trusted; various things call up into
osi_dnlc_purgefoo to invalidate entries.  I think all that's needed is
to get dnlc_purgefoo to call into OS-specific code to tag for
revalidation any dentries that the vfs may have cached.  I'll try to
take a stab at this for Linux.

To return to an earlier question: should we even bother with dnlc on
platforms like linux which have a fancy, dynamically allocated dentry
cache?  I only really know Linux ... what do other platforms have here?



john