full/empty terminology in _malloc.h

Matthew Dillon dillon at backplane.com
Tue May 18 17:05:26 PDT 2021


The comments are indeed confusing.  The full and empty fields in the
structure refer to the state of the fobjs[] array.  So full means that
nothing is allocated out of the slab and that the slab can be freed.  And
empty means that everything is allocated out of the slab and there are no
objects left to allocate from that slab.

The other comments are somewhat stale and talked about prior iterations of
the code for the most part.  For example, I originally intended to make
'active' and 'alternate' a list, but ultimately chose to make them single
entities.  'partial', 'full', and 'empty' are lists of slabs.  I'll do a
pass to clean up the comments.

By the way, we still have a fragmentation problem :-(.  Its not as bad as
it was before, but it is still there.  At least with kmalloc_obj being
per-zone, things like tmpfs which allocate zones for each mount can
completely recover the related memory on umount (which helps dsynth out a
lot).

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20210518/c0a8e176/attachment.htm>


More information about the Kernel mailing list