Re: repeated failed open()'s results in lots of used memory [Was:

Linus Torvalds (torvalds@transmeta.com)
Wed, 1 Aug 2001 16:14:26 -0700 (PDT)


On Wed, 1 Aug 2001, Alexander Viro wrote:
>
>
> On Wed, 1 Aug 2001, Linus Torvalds wrote:
>
> > - make all the things that shrink dentries (notably the
> > shrink_dcache_memory() function) call the above function first.
> >
> > Does that fix the behaviour for you?
>
> That will kill _all_ negative dentries whenever we get any amount of
> memory pressure. For stuff a-la $PATH it will get very ugly - currently
> we have a lot of negative dentries in /usr/local/bin that prevent tons
> of bogus lookups there,

I agree. I'm a big fan of negative dentries myself.

However, I'd like to see what the patch does for the bad case first, and
then we can see whether there are less drastic methods (like only killing
half of the negative dentries or something).

The current behaviour obviously has some problems, and negative dentries
_are_ different from positive ones. Trond (or somebody - maybe it was
Neil) also mentioned that negative dentries tend to hurt some NFS
benchmarks by virtue of filling up memory a bit too much.

Btw, my fix description wasn't perfect - you need to get things like the
unused dentry counts right too, etc. The basic approach stands, though.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/