aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/zfs/aggsum.c
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2021-01-07 23:27:17 +0000
committerMatt Macy <mmacy@FreeBSD.org>2021-01-08 00:55:59 +0000
commit7877fdebeeb35fad1cbbafce22598b1bdf97c786 (patch)
tree10ccc0bab059d6f48a221045b92416fc347fe784 /sys/contrib/openzfs/module/zfs/aggsum.c
parent84089de83e79a0f748c6e22b1aacb59156e153d2 (diff)
OpenZFS merge main-gf11b09
- add dRAID support - fix duplicate close handling - fix memory leak in prefetch - fix problem with SIMD benchmarking on FreeBSD boot ...
Diffstat (limited to 'sys/contrib/openzfs/module/zfs/aggsum.c')
-rw-r--r--sys/contrib/openzfs/module/zfs/aggsum.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/contrib/openzfs/module/zfs/aggsum.c b/sys/contrib/openzfs/module/zfs/aggsum.c
index a2fec27744e1..e46da95f676c 100644
--- a/sys/contrib/openzfs/module/zfs/aggsum.c
+++ b/sys/contrib/openzfs/module/zfs/aggsum.c
@@ -70,6 +70,11 @@
* zeroing out the borrowed value (forcing that thread to borrow on its next
* request, which will also be expensive). This is what makes aggsums well
* suited for write-many read-rarely operations.
+ *
+ * Note that the aggsums do not expand if more CPUs are hot-added. In that
+ * case, we will have less fanout than boot_ncpus, but we don't want to always
+ * reserve the RAM necessary to create the extra slots for additional CPUs up
+ * front, and dynamically adding them is a complex task.
*/
/*
@@ -167,9 +172,7 @@ aggsum_add(aggsum_t *as, int64_t delta)
struct aggsum_bucket *asb;
int64_t borrow;
- kpreempt_disable();
- asb = &as->as_buckets[CPU_SEQID % as->as_numbuckets];
- kpreempt_enable();
+ asb = &as->as_buckets[CPU_SEQID_UNSTABLE % as->as_numbuckets];
/* Try fast path if we already borrowed enough before. */
mutex_enter(&asb->asc_lock);