Before we go gung ho on this, there's no evidence that N discontiguous
ranges in one command are any better than the ranges sent N times ...
the same amount of erase overhead gets sent on SSDs.
No, we do have evidence: execution time of the TRIM commands on the SSD.
The one-range-at-a-time is incredibly slow compared to multiple
ranges at a time. That slowness comes from somewhere, with about
99.9% certainty that it is due to the drive performing slow flash
erase cycles.
Mark, I think you are over-generalizing here. You have observed with
some number of flash drives --- maybe only one, but I don't know that
for sure --- that TRIM is slow. Even if we grant that you are correct
in your conclusion that it is because the drive is doing slow flash
erase cycles (and I don't completely accept that; I haven't seen your
your measurements since we know that any kind of command that requires
a queue drain/flush before it can execute is going to be slow, and I
don't know what kind of _slow_ you are observing).