From 3b9283c589c1a0092d017c7f4c8ba24fddb2dffb Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 14 May 2016 17:25:00 +0200 Subject: [PATCH 206/257] zone.9: Document uma_prealloc() and uma_zone_reserve() Obtained from: ElectroBSD --- share/man/man9/zone.9 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 index 798be1c20fdf..3636a5ecfa98 100644 --- a/share/man/man9/zone.9 +++ b/share/man/man9/zone.9 @@ -29,6 +29,7 @@ .Dt ZONE 9 .Os .Sh NAME +.Nm uma_prealloc , .Nm uma_zcreate , .Nm uma_zalloc , .Nm uma_zalloc_arg , @@ -36,6 +37,7 @@ .Nm uma_zfree_arg , .Nm uma_find_refcnt , .Nm uma_zdestroy , +.Nm uma_zone_reserve , .Nm uma_zone_set_max, .Nm uma_zone_get_max, .Nm uma_zone_get_cur, @@ -46,6 +48,8 @@ .In sys/param.h .In sys/queue.h .In vm/uma.h +.Ft void +.Fn uma_prealloc "uma_zone_t zone" "int nitems" .Ft uma_zone_t .Fo uma_zcreate .Fa "char *name" "int size" @@ -64,6 +68,8 @@ .Fn uma_find_refcnt "uma_zone_t zone" "void *item" .Ft void .Fn uma_zdestroy "uma_zone_t zone" +.Ft void +.Fn uma_zone_reserve "uma_zone_t zone" "int nitems" .Ft int .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" .Ft int @@ -272,6 +278,21 @@ must have been freed with before. .Pp The +.Fn uma_prealloc +function pre-fills a zone with items. +This function is blocking and should be called before the zone is used. +.Pp +The +.Fn uma_zone_reserve +function sets a reserve of items to hold for +.Dv M_USE_RESERVE +allocations. +No new items are allocated. +The +.Fn uma_prealloc +function can be used to fill the reserve before it is needed. +.Pp +The .Fn uma_zone_set_max function limits the number of items .Pq and therefore memory -- 2.11.0