On Sat, 11 May 2024 at 08:59, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > Some multiple of "number of positive dentries" might make sense. The thing is, it would probably have to be per parent-dentry to be useful, since that is typically what causes latency concerns: not "global negative dentries", but "negative dentries that have to be flushed for this parent as it is deleted". And you'd probably need to make the child list be some kind of LRU list to make this all effective. Which is all likely rather expensive in both CPU time (stats tend to cause lots of dirty caches) and in memory (the dentry would grow for both stats and for the d_children list - it would almost certainly have to change from a 'struct hlist_head' to a 'struct list_head' so that you can put things either at the to the beginning or end). I dunno. I haven't looked at just *how* nasty it would be. Maybe it wouldn't be as bad as I suspect it would be. Now, the other option might be to just make the latency concerns smaller. It's not like removing negative dentries is very costly per se. I think the issue has always been the dcache_lock, not the work to remove the dentries themselves. Linus