summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-05 21:56:47 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-10 15:34:10 -0400
commitd87aa80b94d62efe124e492590547960e9d2f9a7 (patch)
treedfe9288195c4439dbffe2ff43cf8831c155d9535 /include
parent962ed1e2aa81f9a07ff5f1b6c1e74ba45927e3aa (diff)
time_stats: Kill TIME_STATS_HAVE_QUANTILES
We have 4 spare bytes next to the spinlock, no need for bit stuffing Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'include')
-rw-r--r--include/linux/time_stats.h19
1 files changed, 5 insertions, 14 deletions
diff --git a/include/linux/time_stats.h b/include/linux/time_stats.h
index 4e1f5485ed03..6df2b34aa274 100644
--- a/include/linux/time_stats.h
+++ b/include/linux/time_stats.h
@@ -68,6 +68,7 @@ struct time_stat_buffer {
struct time_stats {
spinlock_t lock;
+ bool have_quantiles;
/* all fields are in nanoseconds */
u64 min_duration;
u64 max_duration;
@@ -87,12 +88,6 @@ struct time_stats {
struct mean_and_variance_weighted freq_stats_weighted;
struct time_stat_buffer __percpu *buffer;
-/*
- * Is this really a struct time_stats_quantiled? Hide this flag in the least
- * significant bit of the start time to avoid blowing up the structure size.
- */
-#define TIME_STATS_HAVE_QUANTILES (1ULL << 0)
-
u64 start_time;
};
@@ -103,13 +98,9 @@ struct time_stats_quantiles {
static inline struct quantiles *time_stats_to_quantiles(struct time_stats *stats)
{
- struct time_stats_quantiles *statq;
-
- if (!(stats->start_time & TIME_STATS_HAVE_QUANTILES))
- return NULL;
-
- statq = container_of(stats, struct time_stats_quantiles, stats);
- return &statq->quantiles;
+ return stats->have_quantiles
+ ? &container_of(stats, struct time_stats_quantiles, stats)->quantiles
+ : NULL;
}
void __time_stats_clear_buffer(struct time_stats *, struct time_stat_buffer *);
@@ -169,7 +160,7 @@ static inline void time_stats_quantiles_exit(struct time_stats_quantiles *statq)
static inline void time_stats_quantiles_init(struct time_stats_quantiles *statq)
{
time_stats_init(&statq->stats);
- statq->stats.start_time |= TIME_STATS_HAVE_QUANTILES;
+ statq->stats.have_quantiles = true;
memset(&statq->quantiles, 0, sizeof(statq->quantiles));
}