Document some flags to the uma_zcreate(). Not all flags are documented,

only those that at least are used in the kernel, or that definitely
work.
This commit is contained in:
Gleb Smirnoff 2013-03-21 16:19:46 +00:00
parent 07f490ac97
commit b7e2b86cec

View File

@ -139,6 +139,60 @@ and
.Fn uma_zfree
but rather in a batch mode on several objects.
.Pp
The
.Fa flags
argument of the
.Fn uma_zcreate
is a subset of the following flags:
.Bl -tag -width "foo"
.It Dv UMA_ZONE_NOFREE
Slabs of the zone are never returned back to VM.
.It Dv UMA_ZONE_REFCNT
Each item in the zone would have internal reference counter associated with it.
See
.Fn uma_find_refcnt .
.It Dv UMA_ZONE_NODUMP
Pages belonging to the zone will not be included into mini-dumps.
.It Dv UMA_ZONE_OFFPAGE
By default book-keeping of items within a slab is done in the slab page itself.
This flag explicitly tells subsystem that book-keeping structure should be
allocated separately from special internal zone.
This flag requires either
.Dv UMA_ZONE_VTOSLAB
or
.Dv UMA_ZONE_HASH ,
since subsystem requires a mechanism to find a book-keeping structure
to an item beeing freed.
The subsystem may choose to prefer offpage book-keeping for certain zones
implicitly.
.It Dv UMA_ZONE_ZINIT
The zone will have its
.Ft uma_init
method set to internal method that initializes a new allocated slab
to all zeros.
Don't mistake
.Ft uma_init
method with
.Ft uma_ctor .
A zone with
.Dv UMA_ZONE_ZINIT
flag would not return zeroed memory on every
.Fn uma_zalloc .
.It Dv UMA_ZONE_HASH
The zone should use an internal hash table to find slab book-keeping
structure where an allocation being freed belongs to.
.It Dv UMA_ZONE_VTOSLAB
The zone should use special field of
.Vt vm_page_t
to find slab book-keeping structure where an allocation being freed belongs to.
.It Dv UMA_ZONE_MALLOC
The zone is for the
.Xr malloc 9
subsystem.
.It Dv UMA_ZONE_VM
The zone is for the VM subsystem.
.El
.Pp
To allocate an item from a zone, simply call
.Fn uma_zalloc
with a pointer to that zone