>Frankly, I'd rather moved setting DCACHE_REFERENCED to dput(). We don't
>care for that bit for dentries with positive ->d_count.
>So I'd just do
>vi fs/dcache.c -c '/|= DCACHE_R/d|/nr_un/pu|<|x'
>and be done with that. Linus?
Some possibly minor issues with that:
- accessing foo/../bar, won't mark foo as referenced, even though it
might be being referenced frequently. Probably not a common case for foo
to be accessed exclusively in this way, but it could be fixed by marking
a dentry referenced when following ".."
- currently, negative dentries start off unreferenced and get marked
referenced the second and subsequent time that they're used. This would
change to starting off referenced (by the ref count set in lock_nd()
after the ->lookup()) but then not being marked referenced ever again,
as they're always looked at under dcache_lock, and no count is taken on
them. So used-once negative dentries would hang around longer, and
frequently-used negative dentries would be cleaned up sooner.
- referenced bit will be set possibly long after the reference is
actually taken/used, which might make dentry pruning a little less
I was considering suggesting moving the reference bit setting to
unlock_nd(), since that's another place where we're already changing
d_count, but that still has the first two problems that I mentioned.
Either way, moving d_vfsflags to the same cacheline as d_count would
probably be a good idea.