Re: Limit hash table size

Andi Kleen
2004-02-06T01:57:53Z

Andrew Morton <akpm@osdl.org> writes:

> Ken, I remain unhappy with this patch. If a big box has 500 million
> dentries or inodes in cache (is possible), those hash chains will be more
> than 200 entries long on average. It will be very slow.

How about limiting the global size of the dcache in this case ?

I cannot imagine a workload where it would make sense to ever cache
500 million dentries. It just risks to keep the whole file system
after an updatedb in memory on a big box, which is not necessarily
good use of the memory.

Limiting the number of dentries would keep the hash chains at a
reasonable length too and somewhat bound the worst case CPU
use for cache misses and search time in cache lookups.

-Andi