Quote Originally Posted by Anvil View Post
@overthere

So how would deleting say 4000 files look like if the LBAs weren't contiguous, lets say there were 500 ranges?
That's a good question.

Unfortunately I do not know what particular algorithm(s) the filesystem would use under such circumstances. I could speculate, but I am loathe to do so - and least generally

There are, however, some empirical metrics captured by hIOmon that might provide some general clues perhaps - which BTW is intentional by design.

For example, if you take a look at Ao1's post #69, you will see a value of 1 for the "Control_MDSA_Trim_DSR_Count_IOP_Min" metric. This metric indicates the observed minimum total number of DSRs specified by a single TRIM control I/O operation (i.e., the combined total number of DSRs specified by a single TRIM I/O operation).

On the other hand, the "Control_MDSA_Trim_DSR_Count_IOP_Max" metric has a value of 62, which indicates that the maximum total number of DSRs specified by a single TRIM control I/O operation was 62 DSRs. (I seem to recall hearing that the ATA spec notes some option (?) about limiting the count to 64 or so, but I'm not sure about this).

From an overall perspective, the "Control_MDSA_Trim_DSR_Count" metric indicates that there was a combined total of 274 102 DSRs specified by the TRIM control I/O operations so far (the "IOPcount_Control_MDSA_Trim" metric - not shown - would indicate the actual total number of observed TRIM control I/O operations associated with this grand total of 274 102 DSRs).

One other quick note in regards to a single TRIM control I/O operation: The "Control_MDSA_Trim_DSR_Length_Total_IOP_Min" metric indicates the minimum total combined lengths (in bytes) of the DSRs specified by a single TRIM control I/O operation. The value shown in Ao1's post is 430 231 552 (which again reflects the minimum total number of bytes specified by a single TRIM control I/O operation).

The "Control_MDSA_Trim_DSR_Length_Total_IOP_Max" metric (not shown in Ao1's post) indicates the maximum total number of bytes specified by a single TRIM control I/O operation.