News for hackers. Stuff that matters.
Re:Container Isolation Gone Wrong by caf on Wednesday June 28, 2017 @09:42PM (#14660124)
If your dcache is growing to the point that each bucket has many entries in it, you can also increase the number of buckets in the hash table using the dhash_entries kernel command-line option.

(The latency in this situation is caused not by the sheer number of entries, but by the fact that the hash table is undersized for the number of entries it gets).

Re:Container Isolation Gone Wrong by haikuginger on Wednesday June 28, 2017 @11:02PM (#14660458)
Out of curiosity, do you know why the kernel uses a fixed-size hash table as opposed to a dynamically-expanding one?
Re:Container Isolation Gone Wrong by caf on Thursday June 29, 2017 @01:13AM (#14660954)
I'm not sure I can give a definitive answer, but there's a few difficulties in making it expand. One is that in the kernel, you can only reliably make large contiguous kmalloc() allocations at init time; another is that the dentry cache is highly optimised for parallel access (most lookups will proceed without taking locks under Read-Copy-Update).

In most cases memory pressure will tend to naturally limit the dentry cache size - the "perfect storm" here was almost zero memory pressure combined with a process doing a lot of negative lookups on an essentially endless list of unique filenames. For such an unusual situation, it's probably reasonable to ask the administrator to manually tune things, rather than building a more complex runtime-resizing hashtable that almost everyone won't need - especially since the failure mode is a graceful performance degradation.