]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Introduce write-mostly sums
authorAlexander Motin <mav@FreeBSD.org>
Thu, 27 May 2021 20:27:29 +0000 (16:27 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Jun 2021 20:05:34 +0000 (13:05 -0700)
commit85c43508f3cc5ff57b1cd53a42ea932c9c25464d
treee17168e77583fa69601fc0472d4025447cc311ef
parent09c0a8fd1a3a69bbb212aa0f507f54d9ff55b5e2
Introduce write-mostly sums

wmsum counters are a reduced version of aggsum counters, optimized for
write-mostly scenarios.  They do not provide optimized read functions,
but instead allow much cheaper add function.  The primary usage is
infrequently read statistic counters, not requiring exact precision.

The Linux implementation is directly mapped into percpu_counter KPI.
The FreeBSD implementation is directly mapped into counter(9) KPI.
In user-space due to lack of better implementation mapped to aggsum.

Unfortunately neither Linux percpu_counter nor FreeBSD counter(9)
provide sufficient functionality to completelly replace aggsum, so
it still remains to be used for several hot counters.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12114
config/kernel-percpu.m4
include/os/freebsd/spl/sys/Makefile.am
include/os/freebsd/spl/sys/wmsum.h [new file with mode: 0644]
include/os/linux/spl/sys/Makefile.am
include/os/linux/spl/sys/wmsum.h [new file with mode: 0644]
include/sys/dataset_kstats.h
lib/libspl/include/sys/Makefile.am
lib/libspl/include/sys/wmsum.h [new file with mode: 0644]
module/zfs/arc.c
module/zfs/dataset_kstats.c