summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat/memstat_uma.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2013-06-18 04:50:20 +0000
committerjeff <jeff@FreeBSD.org>2013-06-18 04:50:20 +0000
commitcca9ad5b9466d39cb2808b73e3fb7e7eb309528b (patch)
tree1210fd4bb9351875805216db871e4a8d96ef6da0 /lib/libmemstat/memstat_uma.c
parentaa062bf6589686389ca402c436434104bf4ecd10 (diff)
downloadFreeBSD-src-cca9ad5b9466d39cb2808b73e3fb7e7eb309528b.zip
FreeBSD-src-cca9ad5b9466d39cb2808b73e3fb7e7eb309528b.tar.gz
Refine UMA bucket allocation to reduce space consumption and improve
performance. - Always free to the alloc bucket if there is space. This gives LIFO allocation order to improve hot-cache performance. This also allows for zones with a single bucket per-cpu rather than a pair if the entire working set fits in one bucket. - Enable per-cpu caches of buckets. To prevent recursive bucket allocation one bucket zone still has per-cpu caches disabled. - Pick the initial bucket size based on a table driven maximum size per-bucket rather than the number of items per-page. This gives more sane initial sizes. - Only grow the bucket size when we face contention on the zone lock, this causes bucket sizes to grow more slowly. - Adjust the number of items per-bucket to account for the header space. This packs the buckets more efficiently per-page while making them not quite powers of two. - Eliminate the per-zone free bucket list. Always return buckets back to the bucket zone. This ensures that as zones grow into larger bucket sizes they eventually discard the smaller sizes. It persists fewer buckets in the system. The locking is slightly trickier. - Only switch buckets in zalloc, not zfree, this eliminates pathological cases where we ping-pong between two buckets. - Ensure that the thread that fills a new bucket gets to allocate from it to give a better upper bound on allocation time. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libmemstat/memstat_uma.c')
-rw-r--r--lib/libmemstat/memstat_uma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index 040198c..b8ff3a1 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -446,7 +446,7 @@ skip_percpu:
kz.uk_ipers;
mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
- for (ubp = LIST_FIRST(&uz.uz_full_bucket); ubp !=
+ for (ubp = LIST_FIRST(&uz.uz_buckets); ubp !=
NULL; ubp = LIST_NEXT(&ub, ub_link)) {
ret = kread(kvm, ubp, &ub, sizeof(ub), 0);
mtp->mt_zonefree += ub.ub_cnt;
OpenPOWER on IntegriCloud