Re: negative dentries wasting ram

Andrea Arcangeli
2002-05-24T16:40:22Z

On Fri, May 24, 2002 at 09:29:56AM -0700, Linus Torvalds wrote:
>
> On Fri, 24 May 2002, Alexander Viro wrote:
> >
> > On Fri, 24 May 2002, Linus Torvalds wrote:
> >
> > > However, you're right that it probably doesn't help to do this after
> > > "unlink()" - it's probably only worth doing when actually doing a
> > > "lookup()" that fails.
> >
> > Depends on many things, including the amount of userland code that does
> > unlink(name);
> > open(name, O_CREAT|O_EXCL..., ...);
>
> Note that this will have to touch the FS anyway, since the O_CREAT thing
> forces a call down to the FS to actually create the file.

yep. the only case where it could provide some in-core "caching"
positive effect is:

unlink
open(w/o creat)

but I don't see it as a common case.

> The only think we save is a dentry kfree/kmalloc in this case, nbot a FS

agreed.

Andrea