[lkml]   [2004]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Large slab cache in 2.6.1
--Andrew Morton <> wrote (on Saturday, February 21, 2004 22:15:53 -0800):

> Linus Torvalds <> wrote:
>> What happened to the experiment of having slab pages on the (in)active
>> lists and letting them be free'd that way? Didn't somebody already do
>> that? Ed Tomlinson and Craig Kulesa?
> That was Ed. Because we cannot reclaim slab pages direct from the LRU it
> turned out that putting slab pages onto the LRU was merely an extremely
> complicated way of making the VFS cache scanning rate porportional to the
> pagecache scanning rate. So we ended up doing just that, without putting
> the slab pages on the LRU.

I still don't understand the rationale behind the way we currently do it -
perhaps I'm just being particularly dense. If we have 10,000 pages full of
dcache, and start going through shooting entries by when they were LRU wrt
the entries, not the dcache itself, then (assuming random access to dcache),
we'll evenly shoot the same number of entries from each dcache page without
actually freeing any pages at all, just trashing the cache.

Now I'm aware access isn't really random, which probably saves our arse.
But then some of the entries will be locked too, which only makes things
worse (we free a bunch of entries from that page, but the page itself
still isn't freeable). So it still seems likely to me that we'll blow
away at least half of the dcache entries before we free any significant
number of pages at all. That seems insane to me. Moreover, the more times
we shrink & fill, the worse the layout will get (less grouping of "recently
used entries" into the same page).

Moreover, it seems rather expensive to do a write operation for each
dentry to maintain the LRU list over entries. But maybe we don't do that
anymore with dcache RCU - I lost track of what that does ;-( So doing it
on the page LRU basis still makes a damned sight more sense to me. Don't
we want semantics like "once used vs twice used" preference treatment
for dentries, etc anyway?

If someone has the patience to explain exactly why I'm crazy (on this topic,
not in general) I'd appreciate it ;-)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:01    [W:0.116 / U:3.480 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site