zone.9 (98e0ffaefb0f241cda3a72395d3be04192ae0d47) zone.9 (54503a13d8711f183ffedbf6a994ae79108b791b)
1.\"-
2.\" Copyright (c) 2001 Dag-Erling Coïdan Smørgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
1.\"-
2.\" Copyright (c) 2001 Dag-Erling Coïdan Smørgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd February 7, 2014
28.Dd December 20, 2015
29.Dt ZONE 9
30.Os
31.Sh NAME
32.Nm uma_zcreate ,
33.Nm uma_zalloc ,
34.Nm uma_zalloc_arg ,
35.Nm uma_zfree ,
36.Nm uma_zfree_arg ,
37.Nm uma_find_refcnt ,
38.Nm uma_zdestroy ,
39.Nm uma_zone_set_max,
40.Nm uma_zone_get_max,
41.Nm uma_zone_get_cur,
29.Dt ZONE 9
30.Os
31.Sh NAME
32.Nm uma_zcreate ,
33.Nm uma_zalloc ,
34.Nm uma_zalloc_arg ,
35.Nm uma_zfree ,
36.Nm uma_zfree_arg ,
37.Nm uma_find_refcnt ,
38.Nm uma_zdestroy ,
39.Nm uma_zone_set_max,
40.Nm uma_zone_get_max,
41.Nm uma_zone_get_cur,
42.Nm uma_zone_set_warning
42.Nm uma_zone_set_warning,
43.Nm uma_zone_set_maxaction
43.Nd zone allocator
44.Sh SYNOPSIS
45.In sys/param.h
46.In sys/queue.h
47.In vm/uma.h
48.Ft uma_zone_t
49.Fo uma_zcreate
50.Fa "char *name" "int size"

--- 15 unchanged lines hidden (view full) ---

66.Ft int
67.Fn uma_zone_set_max "uma_zone_t zone" "int nitems"
68.Ft int
69.Fn uma_zone_get_max "uma_zone_t zone"
70.Ft int
71.Fn uma_zone_get_cur "uma_zone_t zone"
72.Ft void
73.Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning"
44.Nd zone allocator
45.Sh SYNOPSIS
46.In sys/param.h
47.In sys/queue.h
48.In vm/uma.h
49.Ft uma_zone_t
50.Fo uma_zcreate
51.Fa "char *name" "int size"

--- 15 unchanged lines hidden (view full) ---

67.Ft int
68.Fn uma_zone_set_max "uma_zone_t zone" "int nitems"
69.Ft int
70.Fn uma_zone_get_max "uma_zone_t zone"
71.Ft int
72.Fn uma_zone_get_cur "uma_zone_t zone"
73.Ft void
74.Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning"
75.Ft void
76.Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)"
74.In sys/sysctl.h
75.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
76.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr
77.Fn SYSCTL_UMA_CUR parent nbr name access zone descr
78.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr
79.Sh DESCRIPTION
80The zone allocator provides an efficient interface for managing
81dynamically-sized collections of items of similar size.

--- 220 unchanged lines hidden (view full) ---

302determine an exact value is not performed by the implementation.
303This ensures low overhead at the expense of potentially stale data being used
304in the calculation.
305.Pp
306The
307.Fn uma_zone_set_warning
308function sets a warning that will be printed on the system console when the
309given zone becomes full and fails to allocate an item.
77.In sys/sysctl.h
78.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
79.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr
80.Fn SYSCTL_UMA_CUR parent nbr name access zone descr
81.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr
82.Sh DESCRIPTION
83The zone allocator provides an efficient interface for managing
84dynamically-sized collections of items of similar size.

--- 220 unchanged lines hidden (view full) ---

305determine an exact value is not performed by the implementation.
306This ensures low overhead at the expense of potentially stale data being used
307in the calculation.
308.Pp
309The
310.Fn uma_zone_set_warning
311function sets a warning that will be printed on the system console when the
312given zone becomes full and fails to allocate an item.
310The warning will be printed not often than every five minutes.
313The warning will be printed no more often than every five minutes.
311Warnings can be turned off globally by setting the
312.Va vm.zone_warnings
313sysctl tunable to
314.Va 0 .
315.Pp
316The
314Warnings can be turned off globally by setting the
315.Va vm.zone_warnings
316sysctl tunable to
317.Va 0 .
318.Pp
319The
320.Fn uma_zone_set_maxaction
321function sets a function that will be called when the given zone becomes full
322and fails to allocate an item.
323The function will be called with the zone locked. Also, the function
324that called the allocation function may have held additional locks. Therefore,
325this function should do very little work (similar to a signal handler).
326.Pp
327The
317.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
318macro declares a static
319.Xr sysctl
320oid that exports the effective upper limit number of items for a zone.
321The
322.Fa zone
323argument should be a pointer to
324.Vt uma_zone_t .

--- 51 unchanged lines hidden ---
328.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
329macro declares a static
330.Xr sysctl
331oid that exports the effective upper limit number of items for a zone.
332The
333.Fa zone
334argument should be a pointer to
335.Vt uma_zone_t .

--- 51 unchanged lines hidden ---