| 85 | static uint_t aggsum_borrow_multiplier = 10; |
| 86 | |
| 87 | void |
| 88 | aggsum_init(aggsum_t *as, uint64_t value) |
| 89 | { |
| 90 | bzero(as, sizeof (*as)); |
| 91 | as->as_lower_bound = as->as_upper_bound = value; |
| 92 | mutex_init(&as->as_lock, NULL, MUTEX_DEFAULT, NULL); |
| 93 | as->as_numbuckets = boot_ncpus; |
| 94 | as->as_buckets = kmem_zalloc(boot_ncpus * sizeof (aggsum_bucket_t), |
| 95 | KM_SLEEP); |
| 96 | for (int i = 0; i < as->as_numbuckets; i++) { |
| 97 | mutex_init(&as->as_buckets[i].asc_lock, |
| 98 | NULL, MUTEX_DEFAULT, NULL); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | void |
| 103 | aggsum_fini(aggsum_t *as) |
no test coverage detected