aboutsummaryrefslogtreecommitdiff
path: root/lib/libmemstat
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2019-01-15 00:02:06 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2019-01-15 00:02:06 +0000
commitbb15d1c77834836c32a6ce7e586e4ec4c784ae7f (patch)
treee32945886083e02d02d7c65d6a69a5de8ad6b5c4 /lib/libmemstat
parent76c528d3509c759d6e18253644e727e6cc633d4c (diff)
o Move zone limit from keg level up to zone level. This means that now
two zones sharing a keg may have different limits. Now this is going to work: zone = uma_zcreate(); uma_zone_set_max(zone, limit); zone2 = uma_zsecond_create(zone); uma_zone_set_max(zone2, limit2); Kegs no longer have uk_maxpages field, but zones have uz_items. When set, it may be rounded up to minimum possible CPU bucket cache size. For small limits bucket cache can also be reconfigured to be smaller. Counter uz_items is updated whenever items transition from keg to a bucket cache or directly to a consumer. If zone has uz_maxitems set and it is reached, then we are going to sleep. o Since new limits don't play well with multi-keg zones, remove them. The idea of multi-keg zones was introduced exactly 10 years ago, and never have had a practical usage. In discussion with Jeff we came to a wild agreement that if we ever want to reintroduce the idea of a smart allocator that would be able to choose between two (or more) totally different backing stores, that choice should be made one level higher than UMA, e.g. in malloc(9) or in mget(), or whatever and choice should be controlled by the caller. o Sleeping code is improved to account number of sleepers and wake them one by one, to avoid thundering herd problem. o Flag UMA_ZONE_NOBUCKETCACHE removed, instead uma_zone_set_maxcache() KPI added. Having no bucket cache basically means setting maxcache to 0. o Now with many fields added and many removed (no multi-keg zones!) make sure that struct uma_zone is perfectly aligned. Reviewed by: markj, jeff Tested by: pho Differential Revision: https://reviews.freebsd.org/D17773
Notes
Notes: svn path=/head/; revision=343026
Diffstat (limited to 'lib/libmemstat')
-rw-r--r--lib/libmemstat/memstat_uma.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index 423d4711c25e..3a6ac2727546 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -448,12 +448,7 @@ skip_percpu:
mtp->mt_memalloced = mtp->mt_numallocs * mtp->mt_size;
mtp->mt_memfreed = mtp->mt_numfrees * mtp->mt_size;
mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed;
- if (kz.uk_ppera > 1)
- mtp->mt_countlimit = kz.uk_maxpages /
- kz.uk_ipers;
- else
- mtp->mt_countlimit = kz.uk_maxpages *
- kz.uk_ipers;
+ mtp->mt_countlimit = uz.uz_max_items;
mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
for (i = 0; i < ndomains; i++) {