full/empty terminology in _malloc.h
falsifian at falsifian.org
Wed May 19 04:29:40 PDT 2021
On Tue, May 18, 2021 at 03:05:26PM -0900, Matthew Dillon wrote:
> 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
Thanks for the documentation update; much less confusing!
More information about the Kernel