summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorDaniel Hill <daniel@gluo.nz>2022-08-12 09:03:28 +1200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:43 -0400
commitbf8f8b20a1e729170493d99a2014c90c5cf5b84b (patch)
tree8e5c118e09a4ad8427c38312c24a27d5daf0853f /fs/bcachefs/util.h
parent92095781e0f607e735971c1a6462ca6dad8826d2 (diff)
downloadlinux-stable-bf8f8b20a1e729170493d99a2014c90c5cf5b84b.tar.gz
linux-stable-bf8f8b20a1e729170493d99a2014c90c5cf5b84b.tar.bz2
linux-stable-bf8f8b20a1e729170493d99a2014c90c5cf5b84b.zip
bcachefs: time stats now uses the mean_and_variance module.
Signed-off-by: Daniel Hill <daniel@gluo.nz> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r--fs/bcachefs/util.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 3b0090faef4d..4243a22c766c 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
@@ -18,6 +18,8 @@
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
+#include "mean_and_variance.h"
+
struct closure;
#ifdef CONFIG_BCACHEFS_DEBUG
@@ -407,14 +409,18 @@ struct bch2_time_stat_buffer {
struct bch2_time_stats {
spinlock_t lock;
- u64 count;
/* all fields are in nanoseconds */
- u64 average_duration;
- u64 average_frequency;
u64 max_duration;
+ u64 min_duration;
+ u64 max_freq;
+ u64 min_freq;
u64 last_event;
struct bch2_quantiles quantiles;
+ struct mean_and_variance duration_stats;
+ struct mean_and_variance_weighted duration_stats_weighted;
+ struct mean_and_variance freq_stats;
+ struct mean_and_variance_weighted freq_stats_weighted;
struct bch2_time_stat_buffer __percpu *buffer;
};