[nycbug-talk] Slab Allocator

Marc Spitzer mspitzer at gmail.com
Thu Aug 28 12:52:42 EDT 2008

On Thu, Aug 28, 2008 at 5:15 AM, Yarema <yds at coolrat.org> wrote:
> A while ago I read on Matt Dillon's DragonFly diary
> http://www.DragonFlyBSD.org/status/diary.shtml
> that
> # DragonFly now has slab allocator for the kernel! The allocator is
> about 1/3 the size of FreeBSD-5's slab allocator and features per-cpu
> isolation, mutexless operation, cache sensitivity (locality of
> reference), and optimized zeroing code.
> # The core of the slab allocator is MP safe but at the moment we still
> use the malloc_type structure for statistics reporting which is not yet
> MP safe, and the backing store (KVM routines) are not MP safe. Even, so
> making the whole thing MP safe is not expected to be difficult.
> 1/3 the size of FreeBSD-5's slab allocator?!  that's awesome!  DragonFly
> rulez!  er, WTF is a Slab Allocator?

Iff I remember correctly, it is a in kernel memory allocator that
operates under the assumption that I need to allocate lots of things
that are the same size.  And that a good way to do this is to request
a "slab" of memory from the memory allocator thingie and then manage
it internally.  If the kernel was a deli think of it like the
cornedbeef in the steam table.  You the deli guy manage the
sandwitches locally but when you talk to the kitchen you can only ask
for things in terms of a cornedbeef, or brisket, not in terms of I
need 20 sandwitches.

Let this be a lesson to you do not answer email when hungry.


> it's still over my head, but here's where it all started:
> http://Blogs.Sun.com/bonwick/en_US/category/Slab+Allocator
> ... by the creator of ZFS no less.  Good story.
> --
> Yarema
> _______________________________________________
> talk mailing list
> talk at lists.nycbug.org
> http://lists.nycbug.org/mailman/listinfo/talk

Freedom is nothing but a chance to be better.
Albert Camus

More information about the talk mailing list