On Wed, 26 Feb 2025, Al Viro wrote: > On Wed, Feb 26, 2025 at 10:25:12AM +1100, NeilBrown wrote: > > On Tue, 25 Feb 2025, Al Viro wrote: > > > makes simple_lookup() slightly cheaper there. > > > > I think the patch make sense because there is no point keeping negative > > dentries for these filesystems - and positive dentries get an extra > > refcount so DCACHE_DONTCACHE doesn't apply. > > > > But I don't see how this makes simple_lookup() cheaper. It means that > > if someone repeatedly looks up the same non-existent name then > > simple_lookup() will be called more often (because we didn't cache the > > result of the previous time) but otherwise I don't see the relevance to > > simple_lookup(). Am I missing something? > > This: > if (!(dentry->d_flags & DCACHE_DONTCACHE)) { > spin_lock(&dentry->d_lock); > dentry->d_flags |= DCACHE_DONTCACHE; > spin_unlock(&dentry->d_lock); > } Ah - right. Thanks. NeilBrown > > IOW, no need to mark that sucker as "don't retain past the moment when > its refcount drops to zero" - they'll all be marked that way since > they'd been created. > > Note that we used to switch then to ->d_op that had ->d_delete always > returning true. That had been replaced with setting DCACHE_DONTCACHE; > that was an equivalent transformation. So retention rules have not changed; > the only change here is that this flag doesn't need to be set. >