Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/zone.9
Show All 19 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 30, 2019 | .Dd September 1, 2019 | ||||
.Dt UMA 9 | .Dt UMA 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm UMA | .Nm UMA | ||||
.Nd general-purpose kernel object allocator | .Nd general-purpose kernel object allocator | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/queue.h | .In sys/queue.h | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
.Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" | .Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" | ||||
.Ft void | .Ft void | ||||
.Fn uma_prealloc "uma_zone_t zone" "int nitems" | .Fn uma_prealloc "uma_zone_t zone" "int nitems" | ||||
.Ft void | .Ft void | ||||
.Fn uma_zone_reserve "uma_zone_t zone" "int nitems" | .Fn uma_zone_reserve "uma_zone_t zone" "int nitems" | ||||
.Ft void | .Ft void | ||||
.Fn uma_zone_reserve_kva "uma_zone_t zone" "int nitems" | .Fn uma_zone_reserve_kva "uma_zone_t zone" "int nitems" | ||||
.Ft void | .Ft void | ||||
.Fn uma_reclaim "int req" | |||||
.Ft void | |||||
.Fn uma_zone_reclaim "uma_zone_t zone" "int req" | |||||
.Ft void | |||||
.Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" | .Fn uma_zone_set_allocf "uma_zone_t zone" "uma_alloc allocf" | ||||
.Ft void | .Ft void | ||||
.Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" | .Fn uma_zone_set_freef "uma_zone_t zone" "uma_free freef" | ||||
.Ft int | .Ft int | ||||
.Fn uma_zone_set_max "uma_zone_t zone" "int nitems" | .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" | ||||
.Ft int | .Ft int | ||||
.Fn uma_zone_set_maxcache "uma_zone_t zone" "int nitems" | .Fn uma_zone_set_maxcache "uma_zone_t zone" "int nitems" | ||||
.Ft int | .Ft int | ||||
▲ Show 20 Lines • Show All 322 Lines • ▼ Show 20 Lines | |||||
Subsequent allocations from the zone will be satisfied using the pre-allocated | Subsequent allocations from the zone will be satisfied using the pre-allocated | ||||
address space. | address space. | ||||
Note that unlike | Note that unlike | ||||
.Fn uma_zone_reserve , | .Fn uma_zone_reserve , | ||||
.Fn uma_zone_reserve_kva | .Fn uma_zone_reserve_kva | ||||
does not restrict the use of the pre-allocation to | does not restrict the use of the pre-allocation to | ||||
.Dv M_USE_RESERVE | .Dv M_USE_RESERVE | ||||
requests. | requests. | ||||
.Pp | |||||
The | |||||
.Fn uma_reclaim | |||||
and | |||||
.Fn uma_zone_reclaim | |||||
functions reclaim cached items from UMA zones, releasing unused memory. | |||||
The | |||||
.Fn uma_reclaim | |||||
function reclaims items from all regular zones, while | |||||
.Fn uma_zone_reclaim | |||||
reclaims items only from the specified zone. | |||||
The | |||||
.Fa req | |||||
parameter must be one of three values which specify how aggressively | |||||
items are to be reclaimed: | |||||
.Bl -tag -width indent | |||||
.It Dv UMA_RECLAIM_TRIM | |||||
Reclaim items only in excess of the zone's estimated working set size. | |||||
The working set size is periodically updated and tracks the recent history | |||||
of the zone's usage. | |||||
.It Dv UMA_RECLAIM_DRAIN | |||||
Reclaim all items from the unbounded cache. | |||||
Free items in the per-CPU caches are left alone. | |||||
.It Dv UMA_RECLAIM_DRAIN_CPU | |||||
Reclaim all cached items. | |||||
.El | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn uma_zone_set_allocf | .Fn uma_zone_set_allocf | ||||
and | and | ||||
.Fn uma_zone_set_freef | .Fn uma_zone_set_freef | ||||
functions allow a zone's default slab allocation and free functions to be | functions allow a zone's default slab allocation and free functions to be | ||||
overridden. | overridden. | ||||
This is useful if the zone's items have special memory allocation constraints. | This is useful if the zone's items have special memory allocation constraints. | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |