Re: d_splice_alias() problem.

Neil Brown
2004-05-05T00:13:17Z

On Tuesday May 4, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Tue, May 04, 2004 at 05:00:15PM +1000, Greg Banks wrote:
>
> > Ok, how about this...it's portable, and not racy, but may perturb the
> > logic slightly by also taking dentries off the unused list in the case
> > where they already had d_count>=1. I'm not sure how significant that is.
> > In any case this also passes my tests.
>
> a) ask RCU folks to review - the current logics in dcache.c is extremely
> brittle as it is.
>
> b) after rereading that code, I _really_ don't like the crap with "hashed
> but disconnected" nfsd is pulling off. Neil, care to give detailed reasons
> why you are doing that?

As a quick answer, below is a copy of an email from Christoph Hellwig
from 18 months ago where says how glad he is to see it and wants to
know if it will stay. Basically, without hashing the dentry, it will
get allocated and deallocated very frequently which has negative
consequences. It would actually be nice to hold a "file" around
instead of just a "dentry", but a dentry is better than nothing.

NeilBrown

From: Neil Brown <neilb@cse.unsw.edu.au>
To: Christoph Hellwig <hch@sgi.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: keeping nfsd dentries on unused_list
Date: Tue, 22 Oct 2002 09:15:54 +1000
Content-Type: text/plain; charset=us-ascii

On Monday October 21, hch@sgi.com wrote:
> Hi Neil,
>
> since your export changes in 2.5.<early> always have a non-empty
> ->d_hash (linked into sb->s_anon) and thus are put on the unused
> list by dput instead of directly reclaiming it.
>
> Is this behaviour intentional and will stay during 2.6? Keeping
> those dentries alive will allow me to remove lots of code in XFS
> to keep inodes that are written to by nfsd in cache as the final
> iput will flush all delayed allocated space and thus decrease
> nfs write performance massively - but as long as the dentry is
> on the unused list after dput we still have an inode reference
> and thus the delalloc block don't need to be converted.

Yes. That behaviour is intentional and will stay.

NeilBrown