On Wed, 13 Mar 2024 at 14:34, Kent Overstreet <kent.overstreet@xxxxxxxxx> wrote: > > I liked your MAD suggestion, but the catch was that we need an > exponentially weighted version, The code for the weighted version literally doesn't change. The variance value is different, but the difference between MAD and standard deviation is basically just a constant factor (which will be different for different distributions, but so what? Any _particular_ case will have a particular distribution). So why would a constant factor make _any_ difference for any exponential weighting? Anyway, feel free to keep your code in bcachefs. And maybe xfs even wants to copy that code. I don't care, it seems stupid, but that's a filesystem choice. But if we're making it a generic kernel library, it needs to be sane. Not making people do 64-bit square roots and 128-bit divides just for a random statistical element. Linus