bcachefs: mean_and_variance: put struct mean_and_variance_weighted on a diet
authorDarrick J. Wong <djwong@kernel.org>
Thu, 8 Feb 2024 23:33:35 +0000 (18:33 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 14 Mar 2024 01:37:58 +0000 (21:37 -0400)
commit4b4f0876ab74167cc402ccd5ce9154e7dc666829
tree17274b58e78f71a8763cf1e035022a32b19be6f9
parentcdbfa228a5537dfd7cbd8532701b0c8af70c97b8
bcachefs: mean_and_variance: put struct mean_and_variance_weighted on a diet

The only caller of this code (time_stats) always knows the weights and
whether or not any information has been collected.  Pass this
information into the mean and variance code so that it doesn't have to
store that information.  This reduces the structure size from 24 to 16
bytes, which shrinks each time_stats counter to 192 bytes from 208.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/mean_and_variance.c
fs/bcachefs/mean_and_variance.h
fs/bcachefs/mean_and_variance_test.c
fs/bcachefs/time_stats.c
fs/bcachefs/time_stats.h
fs/bcachefs/util.c