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 February 7, 2014 | .Dd December 20, 2015 | ||||
.Dt ZONE 9 | .Dt ZONE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm uma_zcreate , | .Nm uma_zcreate , | ||||
.Nm uma_zalloc , | .Nm uma_zalloc , | ||||
.Nm uma_zalloc_arg , | .Nm uma_zalloc_arg , | ||||
.Nm uma_zfree , | .Nm uma_zfree , | ||||
.Nm uma_zfree_arg , | .Nm uma_zfree_arg , | ||||
.Nm uma_find_refcnt , | .Nm uma_find_refcnt , | ||||
.Nm uma_zdestroy , | .Nm uma_zdestroy , | ||||
.Nm uma_zone_set_max, | .Nm uma_zone_set_max, | ||||
.Nm uma_zone_get_max, | .Nm uma_zone_get_max, | ||||
.Nm uma_zone_get_cur, | .Nm uma_zone_get_cur, | ||||
.Nm uma_zone_set_warning | .Nm uma_zone_set_warning, | ||||
.Nm uma_zone_set_maxaction | |||||
.Nd zone allocator | .Nd zone allocator | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/queue.h | .In sys/queue.h | ||||
.In vm/uma.h | .In vm/uma.h | ||||
.Ft uma_zone_t | .Ft uma_zone_t | ||||
.Fo uma_zcreate | .Fo uma_zcreate | ||||
.Fa "char *name" "int size" | .Fa "char *name" "int size" | ||||
Show All 15 Lines | |||||
.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_get_max "uma_zone_t zone" | .Fn uma_zone_get_max "uma_zone_t zone" | ||||
.Ft int | .Ft int | ||||
.Fn uma_zone_get_cur "uma_zone_t zone" | .Fn uma_zone_get_cur "uma_zone_t zone" | ||||
.Ft void | .Ft void | ||||
.Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" | .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" | ||||
.Ft void | |||||
.Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)" | |||||
.In sys/sysctl.h | .In sys/sysctl.h | ||||
.Fn SYSCTL_UMA_MAX parent nbr name access zone descr | .Fn SYSCTL_UMA_MAX parent nbr name access zone descr | ||||
.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr | .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr | ||||
.Fn SYSCTL_UMA_CUR parent nbr name access zone descr | .Fn SYSCTL_UMA_CUR parent nbr name access zone descr | ||||
.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr | .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The zone allocator provides an efficient interface for managing | The zone allocator provides an efficient interface for managing | ||||
dynamically-sized collections of items of similar size. | dynamically-sized collections of items of similar size. | ||||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | |||||
determine an exact value is not performed by the implementation. | determine an exact value is not performed by the implementation. | ||||
This ensures low overhead at the expense of potentially stale data being used | This ensures low overhead at the expense of potentially stale data being used | ||||
in the calculation. | in the calculation. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn uma_zone_set_warning | .Fn uma_zone_set_warning | ||||
function sets a warning that will be printed on the system console when the | function sets a warning that will be printed on the system console when the | ||||
given zone becomes full and fails to allocate an item. | given zone becomes full and fails to allocate an item. | ||||
The warning will be printed not often than every five minutes. | The warning will be printed no more often than every five minutes. | ||||
Warnings can be turned off globally by setting the | Warnings can be turned off globally by setting the | ||||
.Va vm.zone_warnings | .Va vm.zone_warnings | ||||
sysctl tunable to | sysctl tunable to | ||||
.Va 0 . | .Va 0 . | ||||
.Pp | |||||
The | |||||
.Fn uma_zone_set_maxaction | |||||
function sets a function that will be called when the given zone becomes full | |||||
and fails to allocate an item. | |||||
The function will be called with the zone locked. Also, the function | |||||
that called the allocation function may have held additional locks. Therefore, | |||||
this function should do very little work (similar to a signal handler). | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn SYSCTL_UMA_MAX parent nbr name access zone descr | .Fn SYSCTL_UMA_MAX parent nbr name access zone descr | ||||
macro declares a static | macro declares a static | ||||
.Xr sysctl | .Xr sysctl | ||||
oid that exports the effective upper limit number of items for a zone. | oid that exports the effective upper limit number of items for a zone. | ||||
The | The | ||||
.Fa zone | .Fa zone | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |