diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2010-08-16 14:24:00 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2010-08-16 14:24:00 +0000 |
commit | e49471b04b4bf0bfc58e2feeb0dd4208ea8f7c0d (patch) | |
tree | 53cc3f15371d15c1aca61a769565d66f1f460c83 /sys/vm/uma.h | |
parent | 13852a6e15a94646e958471b91ea96a78b8b658c (diff) | |
download | src-e49471b04b4bf0bfc58e2feeb0dd4208ea8f7c0d.tar.gz src-e49471b04b4bf0bfc58e2feeb0dd4208ea8f7c0d.zip |
Add uma_zone_get_max() to obtain the effective limit after a call
to uma_zone_set_max().
The UMA zone limit is not exactly set to the value supplied but
rounded up to completely fill the backing store increment (a page
normally). This can lead to surprising situations where the number
of elements allocated from UMA is higher than the supplied limit
value. The new get function reads back the effective value so that
the supplied limit value can be adjusted to the real limit.
Reviewed by: jeffr
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=211396
Diffstat (limited to 'sys/vm/uma.h')
-rw-r--r-- | sys/vm/uma.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 2076d3bd0b61..f0522b01631d 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -459,6 +459,18 @@ int uma_zone_set_obj(uma_zone_t zone, struct vm_object *obj, int size); void uma_zone_set_max(uma_zone_t zone, int nitems); /* + * Obtains the effective limit on the number of items in a zone + * + * Arguments: + * zone The zone to obtain the effective limit from + * + * Return: + * 0 No limit + * int The effective limit of the zone + */ +int uma_zone_get_max(uma_zone_t zone); + +/* * The following two routines (uma_zone_set_init/fini) * are used to set the backend init/fini pair which acts on an * object as it becomes allocated and is placed in a slab within |