Re: [PATCH v5 0/6] fs/dcache: Track & limit # of negative dentries
From: Matthew Wilcox
Date: Mon Jul 02 2018 - 18:21:15 EST
On Mon, Jul 02, 2018 at 02:18:11PM -0700, Andrew Morton wrote:
> In the [5/6] changelog it is mentioned that a large number of -ve
> dentries can lead to oom-killings. This sounds bad - -ve dentries
> should be trivially reclaimable and we shouldn't be oom-killing in such
> a situation.
> Dumb question: do we know that negative dentries are actually
> worthwhile? Has anyone checked in the past couple of decades? Perhaps
> our lookups are so whizzy nowadays that we don't need them?
I can't believe that's true. Have you looked at strace of a typical
program startup recently?
$ strace -o ls.out ls
$ grep -c ENOENT ls.out
There's a few duplicates in there (6 accesses to /etc/ld.so.nohwcap), so
we definitely want those negative entries.