Re: [RFC PATCH] greatly reduce SLOB external fragmentation

Jörn Engel
2008-01-10T21:31:58Z

On Thu, 10 January 2008 11:49:25 -0600, Matt Mackall wrote:
>
> b) grouping objects of the same -type- (not size) together should mean
> they have similar lifetimes and thereby keep fragmentation low
>
> (b) is known to be false, you just have to look at our dcache and icache
> pinning.

(b) is half-true, actually. The grouping by lifetime makes a lot of
sense. LogFS has a similar problem to slabs (only full segments are
useful, a single object can pin the segment). And when I grouped my
objects very roughly by their life expectency, the impact was *HUGE*!

In both cases, you want slabs/segments that are either close to 100%
full or close to 0% full. It matters a lot when you have to move
objects around and I would bet it matters even more when you cannot move
objects and the slab just remains pinned.

So just because the type alone is a relatively bad heuristic for life
expectency does not make the concept false. Bonwick was onto something.
He just failed in picking a good heuristic. Quite likely spreading by
type was even a bonus when slab was developed, because even such a crude
heuristic is slightly better than completely randomized lifetimes.

I've been meaning to split the dentry cache into 2-3 seperate ones for a
while and kept spending my time elsewhere. But I remain convinced that
this will make a measurable difference.

Jörn

--
Never argue with idiots - first they drag you down to their level,
then they beat you with experience.
-- unknown