1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-01 17:00:36 +00:00

Document uma_zone_set_max and its non-obvious behaviour.

Reviewed by:	bmilekic
This commit is contained in:
Hartmut Brandt 2003-07-21 14:20:58 +00:00
parent 58aa55efa5
commit d7bbb21a9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117836
2 changed files with 22 additions and 2 deletions

View File

@ -458,5 +458,6 @@ MLINKS+=zone.9 uma_zalloc.9
MLINKS+=zone.9 uma_zcreate.9
MLINKS+=zone.9 uma_zfree.9
MLINKS+=zone.9 uma_zdestroy.9
MLINKS+=zone.9 uma_zone_set_max.9
.include <bsd.prog.mk>

View File

@ -25,14 +25,15 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 18, 2002
.Dd July 21, 2003
.Dt ZONE 9
.Os
.Sh NAME
.Nm uma_zcreate ,
.Nm uma_zalloc ,
.Nm uma_zfree ,
.Nm uma_zdestroy
.Nm uma_zdestroy ,
.Nm uma_zone_set_max
.Nd zone allocator
.Sh SYNOPSIS
.In sys/param.h
@ -50,6 +51,8 @@
.Fn uma_zfree "uma_zone_t zone" "void *item"
.Ft void
.Fn uma_zdestroy "uma_zone_t zone"
.Ft void
.Fn uma_zone_set_max "uma_zone_t zone" "int nitems"
.Sh DESCRIPTION
The zone allocator provides an efficient interface for managing
dynamically-sized collections of items of similar size.
@ -167,6 +170,22 @@ All items allocated from the zone with
must have been freed with
.Fn uma_zfree
before.
.Pp
The purpose of
.Fn uma_zone_set_max
is to limit the maximum amount of memory that the system can dedicated
toward the zone specified by the
.Fa zone
argument.
The
.Fa nitems
argument gives the upper limit of items in the zone.
This limits the total number of items in the zone which includes:
allocated items, free items and free items in the per-cpu caches.
On systems with more than one CPU it may not be possible to allocate
the specified number of items even when there is no shortage of memory,
because all of the remaining free items may be in the caches of the
other CPUs when the limit is hit.
.Sh RETURN VALUES
The
.Fn uma_zalloc