summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2020-02-06 16:21:06 -0500
committerGitHub <[email protected]>2020-02-06 13:21:06 -0800
commite0ce98d57c44b324ffa99f0620ef8721814fc43e (patch)
treed4c2759dd507d4d5bce8b0da685edb38121fa111 /config
parent77122f9d68a3a6e3fbd266652467acbd7b5d3225 (diff)
Reduce number of atomic_add() calls in aggsum
Previous code used 4 atomics to do aggsum_flush_bucket() and 2 more to re-borrow after the flush. But since asc_borrowed and asc_delta are accessed only while holding asc_lock, it makes no any sense to modify as_lower_bound and as_upper_bound in multiple steps. Instead of that the new code uses only 2 atomics in all the cases, one per as_*_bound variable. I think even that is overkill, simple atomic store and load could be used here, since all modifications are done under the as_lock, but there are no such primitives in ZFS code now. While there, make borrow code consider previous borrow value, so that on mixed request patterns reduce chance of needing to borrow again if much larger request follows tiny one that needed borrow. Also reduce as_numbuckets from uint64_t to u_int. It makes no sense to use so large division operation on every aggsum_add(). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Paul Dagnelie <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored-By: iXsystems, Inc. Closes #9930
Diffstat (limited to 'config')
0 files changed, 0 insertions, 0 deletions