Skip to contentSkip to conversation

2.5.33-mm1

DISCUSSION Ed Tomlinson 3 participants 4 messages Sep 4, 2002 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Andrew Morton

ext3_inode_cache 959 2430 448 264 270 1

That's 264 pages in use, 270 total. If there's a persistent gap between these then there is a problem - could well be that slablru is not locating the pages which were liberated by the pruning sufficiently quickly.

Sufficiently quickly is a relative thing. It could also be that by the time the pages are reclaimed another <n> have been cleaned. IMO its no worst than have freeable pages on lru from any other source. If we get close to oom we will call kmem_cache_reap, otherwise we let the lru find the pages.

Quoted 1 line

Calling kmem_cache_reap() after running the pruners will fix that up.

more specificly kmem_cache_reap will clean the one cache with the most free pages...

Quoted 4 lines

What on earth is going on with kmem_cache_reap? Am I missing something, or is that thing 700% overdesigned? Why not just free the darn pages in kmem_cache_free_one()? Maybe hang onto a few pages for cache warmth, but heck.

This might be as simple as we can see the free pages in slabs. We cannot see other freeable pages in the lru. This makes slabs seem like a problem - just because we can see it.

On the other hand we could setup to call __kmem_cache_shrink_locked after pruning a cache - as it is now this will use page_cache_release to free the pages... Need to be careful coding this though.

Andrew, you stated that we need to consider dcache and icache pages as very important ones. I submit that this is what slablru is doing. It is keeping more of these objects around than the previous design, which is what you wanted to see happen.

Still working on a good reply to your design suggestion/questions?

Ed

-------------------------------------------------------

#1 lore raw
Quoted 10 lines · Ed Tomlinson
Quoted 5 lines · Andrew Morton

ext3_inode_cache 959 2430 448 264 270 1

That's 264 pages in use, 270 total. If there's a persistent gap between these then there is a problem - could well be that slablru is not locating the pages which were liberated by the pruning sufficiently quickly.

Sufficiently quickly is a relative thing.

Those pages are useless! It's silly having slab hanging onto them while we go and reclaim useful pagecache instead.

I *really* think we need to throw away those pages instantly.

The only possible reason for hanging onto them is because they're cache-warm. And we need a global-scope cpu-local hot pages queue anyway.

And once we have that, slab _must_ release its warm pages into it. It's counterproductive for slab to hang onto warm pages when, say, a pagefault needs one.

Quoted 4 lines

It could also be that by the time the
pages are reclaimed another <n> have been cleaned. IMO its no worst than have freeable pages on lru from any other source. If we get close to oom we will call kmem_cache_reap, otherwise we let the lru find the pages.

As I say, by not releasing those (useless to slab) pages, we're causing other (useful) stuff to be reclaimed.

#2 lore raw

Hi,

Quoted 5 lines · Andrew Morton

I *really* think we need to throw away those pages instantly.

The only possible reason for hanging onto them is because they're cache-warm. And we need a global-scope cpu-local hot pages queue anyway.

Yep --- except for caches with constructors, for which we do save a bit more by hanging onto the pages for longer.

--Stephen

#3 lore raw
Quoted 5 lines · Stephen C. Tweedie

Hi,

On Tue, Sep 03, 2002 at 08:33:37PM -0700, Andrew Morton wrote:

Quoted 8 lines
Quoted 5 lines

I *really* think we need to throw away those pages instantly.

The only possible reason for hanging onto them is because they're cache-warm. And we need a global-scope cpu-local hot pages queue anyway.

Yep --- except for caches with constructors, for which we do save a bit more by hanging onto the pages for longer.

Ah, of course. Thanks.

We'll still have a significant volume of pre-constructed objects in the partially-full slabs: it seems that these things are fairly prone to internal fragmentation, which works to our advantage in this case.

So yes, perhaps we need to hang onto some preconstructed pages for these slabs, if the internal fragmentation of the existing part-filled slabs is low.