Re: slab needs more agressive trimming

Linus Torvalds (torvalds@transmeta.com)
21 Sep 1997 21:07:31 GMT


In article <Pine.LNX.3.95.970921144610.1202A-100000@localhost>,
Gerard Roudier <groudier@club-internet.fr> wrote:
>
>I just had a look at 2.1.56 and it seems to me that the state machine
>stays parked to a 'reaper' as long as it succeeds for the lower priority,
>first try with i=6.
>The fact that kmem_cache_reap() behaviour does not use the priority (i)
>(forced to 0) is highly broken in my opinion.

No. The original code used the priority, but I removed that because I
found it so tasteless.

>I missed the reason of using always priority 0 for kmem_cache_reap().
>Is its reaping mechanism so broken?

The whole idea of trying to keep unused cached objects around only to
avoid initializing them when we're low of memory is just extremely
broken, imnsho. We want to avoid having to do IO in order to free
memory, and that definitely means that any kmem caches need to flush out
completely - there is no point in trickling them out as far as I can
see.

I have considered moving the slab trimming altogether out of the loop,
and just do it unconditionally before even entering the loop. That would
trim it more aggressively. David, could you try that and see if it works
for your case?

Linus