A slab allocator (removal) update
A slab allocator (removal) update
Posted May 22, 2023 18:08 UTC (Mon) by koverstreet (✭ supporter ✭, #4296)Parent article: A slab allocator (removal) update
As long as running time of the dcache shrinker is linear in the amount of memory being freed, I don't see how runtime would strictly be a problem - if you're allocating a lot of memory, you're going to have to pay to reclaim a lot of memory, this is typical steady state behavior.
Or is this more of a fragmentation problem, since with a large dcache the shrinker isn't likely to be reclaiming objects from the same slabs? That's a trickier problem...
Posted May 22, 2023 18:47 UTC (Mon)
by Paf (subscriber, #91811)
[Link]
Posted May 23, 2023 0:46 UTC (Tue)
by brenns10 (subscriber, #112114)
[Link] (2 responses)
Thankfully, in the "silly" examples of bad workloads, all 21 dentries were created by the same application looking up non-existent files, and they all got added to the LRU at the same time. But if the workload looks at all more complicated with mixed-lifetime objects, it can get ugly.
That said, it may not be that different from other caches, I haven't looked at a lot of others.
Posted May 23, 2023 5:34 UTC (Tue)
by mokki (subscriber, #33200)
[Link] (1 responses)
Posted May 23, 2023 18:03 UTC (Tue)
by WolfWings (subscriber, #56790)
[Link]
There's been numerous attempts to improve the situation over the years, LWN articles about it even, but it never makes progress since it's a relatively niche situation without enough visibility to most kernel devs to maintain momentum to improve the situation. I'm not even sure there's any mechanism to stop the dentry cache purge when memory-pressure triggers it... it may literally scan ALL of cache and purge what it can instead of freeing say a few MB and stopping, I haven't checked the code in depth but that's the general behavior I've seen in the past.
A slab allocator (removal) update
A slab allocator (removal) update
A slab allocator (removal) update
Often, when the kernel tried to free some more memory, the result was soft lockups of over 1 minute in dmesg.
Flushing manually the dentry cache regularly helped. This was ~6 years ago and hopefully there are now better limits to the max amount of negative dentries.
A slab allocator (removal) update
