[03/10] time_stats: fix struct layout bloat

Message ID 170873667989.1860949.8776444464588431097.stgit@frogsfrogsfrogs
State New
Headers
Series [01/10] time_stats: report lifetime of the stats object |

Commit Message

Darrick J. Wong Feb. 24, 2024, 1:10 a.m. UTC
  From: Darrick J. Wong <djwong@kernel.org>

Make these more efficient by getting rid of the holes.  This reduces the
structure size from 224 bytes to 208 bytes.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
 include/linux/time_stats.h |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Patch

diff --git a/include/linux/time_stats.h b/include/linux/time_stats.h
index c05490101d197..1c1ba8efa7bfe 100644
--- a/include/linux/time_stats.h
+++ b/include/linux/time_stats.h
@@ -77,19 +77,19 @@  struct time_stats {
 	u64		last_event;
 	u64		last_event_start;
 
-/*
- * 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;
-
 	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 duration_stats_weighted;
 	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;
 };
 
 struct time_stats_quantiles {