aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/dataset_kstats.h
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2021-05-27 16:27:29 -0400
committerGitHub <[email protected]>2021-05-27 14:27:29 -0600
commit86706441a86d6e947610046bc8fc08c0618e9eaa (patch)
tree5becb19632d5ea76c9f3463d991de8354c3bc8cc /include/sys/dataset_kstats.h
parent2041d6eecd5e88fadf7a8f0d755d3dda938a3127 (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored-By: iXsystems, Inc. Closes #12114
Diffstat (limited to 'include/sys/dataset_kstats.h')
-rw-r--r--include/sys/dataset_kstats.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/sys/dataset_kstats.h b/include/sys/dataset_kstats.h
index 667d1b85f..b165b9857 100644
--- a/include/sys/dataset_kstats.h
+++ b/include/sys/dataset_kstats.h
@@ -27,18 +27,18 @@
#ifndef _SYS_DATASET_KSTATS_H
#define _SYS_DATASET_KSTATS_H
-#include <sys/aggsum.h>
+#include <sys/wmsum.h>
#include <sys/dmu.h>
#include <sys/kstat.h>
-typedef struct dataset_aggsum_stats_t {
- aggsum_t das_writes;
- aggsum_t das_nwritten;
- aggsum_t das_reads;
- aggsum_t das_nread;
- aggsum_t das_nunlinks;
- aggsum_t das_nunlinked;
-} dataset_aggsum_stats_t;
+typedef struct dataset_sum_stats_t {
+ wmsum_t dss_writes;
+ wmsum_t dss_nwritten;
+ wmsum_t dss_reads;
+ wmsum_t dss_nread;
+ wmsum_t dss_nunlinks;
+ wmsum_t dss_nunlinked;
+} dataset_sum_stats_t;
typedef struct dataset_kstat_values {
kstat_named_t dkv_ds_name;
@@ -59,7 +59,7 @@ typedef struct dataset_kstat_values {
} dataset_kstat_values_t;
typedef struct dataset_kstats {
- dataset_aggsum_stats_t dk_aggsums;
+ dataset_sum_stats_t dk_sums;
kstat_t *dk_kstats;
} dataset_kstats_t;