Re: full/empty terminology in _malloc.h
Matthew Dillon <[email protected]> Tue, 18 May 2021 15:05:26 -0900
| Newsgroups | gmane.os.dragonfly-bsd.kernel |
|---|---|
| Message-ID | <CAOZ7CpBrCWEE+ZcSzWPt2M-JVDGTbnCU6Fy2rwqzSHZhSEW4pQ@mail.gmail.com> |
--000000000000121afd05c2a3967a Content-Type: text/plain; charset="UTF-8" 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 --000000000000121afd05c2a3967a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">The comments are indeed confusing.=C2=A0 The full and empt= y fields in the structure refer to the state of the fobjs[] array.=C2=A0 So= full means that nothing is allocated out of the slab and that the slab can= be freed.=C2=A0 And empty means that everything is allocated out of the sl= ab and there are no objects left to allocate from that slab.<div><br></div>= <div>The other comments are somewhat stale and talked about prior iteration= s of the code for the most part.=C2=A0 For example, I originally intended t= o make 'active' and 'alternate' a list, but ultimately chos= e to make them single entities.=C2=A0 'partial', 'full', an= d 'empty' are lists of slabs.=C2=A0 I'll do a pass to clean up = the comments.</div><div><br></div><div>By the way, we still have a fragment= ation problem :-(.=C2=A0 Its not as bad as it was before, but it is still t= here.=C2=A0 At least with kmalloc_obj being per-zone, things like tmpfs whi= ch allocate zones for each mount can completely recover the related memory = on umount (which helps dsynth=C2=A0out a lot).</div><div><br><div>-Matt</di= v></div></div> --000000000000121afd05c2a3967a--