On Sun 25-02-24 19:42:04, Yafang Shao wrote: > In our container environment, we've observed that certain containers may > accumulate more than 40GB of slabs, predominantly negative dentries. These > negative dentries remain unreclaimed unless there is memory pressure. Even > after the containers exit, these negative dentries persist. Have you considered using memory.high limit to trigger that memory reclaim? That is surely not focused on the neg. dentry cache but it should keep the overal memory consumption under control. > To manage disk > storage efficiently, we employ an agent that identifies container images > eligible for destruction once all instances of that image exit. > > However, during destruction, dealing with directories containing numerous > negative dentries can significantly impact performance. Performance of what. I have to say I am kind of lost here. We are talking about memory or a disk storage? > To mitigate this > issue, we aim to proactively reclaim these dentries using a user agent. > Extending the memory.reclaim functionality to specifically target slabs > aligns with our requirements. Matthew has already pointed out that this has been proposed several times already and rejected. Dedicated slab shrinking interface is especially tricky because you would need a way to tell which shrinkers to invoke and that would be very kernel version specific. -- Michal Hocko SUSE Labs