]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement the M_NEXTFIT allocation strategy for vmem(9).
authormarkj <markj@FreeBSD.org>
Sat, 18 May 2019 01:46:38 +0000 (01:46 +0000)
committermarkj <markj@FreeBSD.org>
Sat, 18 May 2019 01:46:38 +0000 (01:46 +0000)
commit7d39a491bfd3fb599c6391bdcae4d82fb494f0d4
tree45622bd9cc292b51dbf567451656fcc8ea2060b1
parent1214634c798d85403918a1979cd41fc1a50c7eec
Implement the M_NEXTFIT allocation strategy for vmem(9).

This is described in the vmem paper: "directs vmem to use the next free
segment after the one previously allocated."  The implementation adds a
new boundary tag type, M_CURSOR, which is linked into the segment list
and precedes the segment following the previous M_NEXTFIT allocation.
The cursor is used to locate the next free segment satisfying the
allocation constraints.

This implementation isn't O(1) since busy tags aren't coalesced, and we
may potentially scan the entire segment list during an M_NEXTFIT
allocation.

Reviewed by: alc
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17226
share/man/man9/vmem.9
sys/kern/subr_vmem.c
sys/sys/malloc.h