Description
The code to calculate the MM "perf improvement score" for a flush had two bugs:
(1) we calculated threshold - current_usage instead of current_usage - threshold, which resulted in a negative score
(2) we had an unsigned integer overflow, which resulted in the above negative score becoming insanely large
These two wrongs "made a right" in which we'd still trigger flushes at the flush threshold, which is why this went unnoticed for quite some time. However, the flushing behavior is more aggressive than originally intended, and we would lose the correct prioritization of flushing tablets that are farther above the threshold.