Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
9223372036854775807
Description
The current "-o discard" mount option for ldiskfs enables on-the-fly TRIM of underlying flash devices (or thinly-provisioned LUNs). However, the current implementation hurts performance because it tracks each block free request explicitly in memory, and submits trim requests to storage on transaction commit.
It would be better to have an async worker thread to issue the TRIM commands using the standard fstrim mechanism, and do this on a per-blockgroup basis, rather than tracking and issuing the trim on a per-extent basis. This reduces both memory and IO overhead, by aggregating TRIM commands for many blocks in a single group.
This would be based on the patches in LU-14712 that make the TRIM state for a block group persistent, so that running TRIM with mke2fs does not also lead to fstrim resubmitting TRIM requests for all of the groups again immediately after mount/remount.