On Tue, Mar 15, 2022 at 01:56:18PM -0700, Roman Gushchin wrote: > > > On Mar 15, 2022, at 12:56 PM, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > > > The number of negative dentries is effectively constrained only by memory > > size. Systems which do not experience significant memory pressure for > > an extended period can build up millions of negative dentries which > > clog the dcache. That can have different symptoms, such as inotify > > taking a long time [1], high memory usage [2] and even just poor lookup > > performance [3]. We've also seen problems with cgroups being pinned > > by negative dentries, though I think we now reparent those dentries to > > their parent cgroup instead. > > Yes, it should be fixed already. > > > > > We don't have a really good solution yet, and maybe some focused > > brainstorming on the problem would lead to something that actually works. > > I’d be happy to join this discussion. And in my opinion it’s going beyond negative dentries: there are other types of objects which tend to grow beyond any reasonable limits if there is no memory pressure. +1, we once had a similar issue as well, and agree that is not only limited to negative dentries but all too many LRU-ed dentries and inodes. Limited the total number may benefit to avoid shrink spiking for servers. Thanks, Gao Xiang > A perfect example when it happens is when a machine is almost idle for some period of time. Periodically running processes creating various kernel objects (mostly vfs cache) which over time are filling significant portions of the total memory. And when the need for memory arises, we realize that the memory is heavily fragmented and it’s costly to reclaim it back. > > Thanks!