aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/zone.9
diff options
context:
space:
mode:
authorLawrence Stewart <lstewart@FreeBSD.org>2010-10-16 04:14:45 +0000
committerLawrence Stewart <lstewart@FreeBSD.org>2010-10-16 04:14:45 +0000
commitc4ae7908a7447b2338cdf7df0408c80a83f517c8 (patch)
tree60814622ef6a50dfe36a1c033e23281a8d0a66fa /share/man/man9/zone.9
parent1636dde95718d9a1f0b66a7a81079cce9aceb4f5 (diff)
downloadsrc-c4ae7908a7447b2338cdf7df0408c80a83f517c8.tar.gz
src-c4ae7908a7447b2338cdf7df0408c80a83f517c8.zip
- Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of a zone. This is useful for providing stats via sysctl amongst other things. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jhb MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=213910
Diffstat (limited to 'share/man/man9/zone.9')
-rw-r--r--share/man/man9/zone.939
1 files changed, 30 insertions, 9 deletions
diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9
index 953c6c1a831f..01f64975120a 100644
--- a/share/man/man9/zone.9
+++ b/share/man/man9/zone.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 19, 2008
+.Dd October 9, 2010
.Dt ZONE 9
.Os
.Sh NAME
@@ -35,7 +35,9 @@
.Nm uma_zfree ,
.Nm uma_zfree_arg ,
.Nm uma_zdestroy ,
-.Nm uma_zone_set_max
+.Nm uma_zone_set_max,
+.Nm uma_zone_get_max,
+.Nm uma_zone_get_cur
.Nd zone allocator
.Sh SYNOPSIS
.In sys/param.h
@@ -59,6 +61,10 @@
.Fn uma_zdestroy "uma_zone_t zone"
.Ft void
.Fn uma_zone_set_max "uma_zone_t zone" "int nitems"
+.Ft int
+.Fn uma_zone_get_max "uma_zone_t zone"
+.Ft int
+.Fn uma_zone_get_cur "uma_zone_t zone"
.Sh DESCRIPTION
The zone allocator provides an efficient interface for managing
dynamically-sized collections of items of similar size.
@@ -170,21 +176,36 @@ must have been freed with
.Fn uma_zfree
before.
.Pp
-The purpose of
+The
.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.
+function limits the number of items
+.Pq and therefore memory
+that can be allocated to
+.Fa zone .
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:
+argument specifies the requested upper limit number of items.
+The effective limit may end up being higher than requested, as the
+implementation will round up to ensure all memory pages allocated to the zone
+are utilised to capacity.
+The limit applies to 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.
+.Pp
+The
+.Fn uma_zone_get_max
+function returns the effective upper limit number of items for a zone.
+.Pp
+The
+.Fn uma_zone_get_cur
+function returns the approximate current occupancy of the zone.
+The returned value is approximate because appropriate synchronisation to
+determine an exact value is not performend by the implementation.
+This ensures low overhead at the expense of potentially stale data being used
+in the calculation.
.Sh RETURN VALUES
The
.Fn uma_zalloc