[LU-14712] improve ldiskfs "-o discard" performance Created: 26/May/21 Updated: 15/Dec/23 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Dongyang Li |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | NVME, ldiskfs, performance | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 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 is done synchronously in the context of the JBD2 commit thread as a commit callback, which blocks later transaction commits. There is work being done in the upstream kernel to improve "-o discard" to use an async worker thread to issue the TRIM commands, and do this on a per-blockgroup basis, rather than issuing the trim on a per-extent basis. Current patch series is at: There are also patches by Shilong 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. Most recent patches at: I think the combination of these two patches would improve ongoing ldiskfs performance on flash devices significantly. |
| Comments |
| Comment by Andreas Dilger [ 09/May/23 ] |
|
Patches to implement the EXT4_BG_WAS_TRIMMED flag to persistently store the TRIM state for each block group are available at: e2fsprogs patches: ext4 kernel patch: It seems possible to use the EXT4_BG_WAS_TRIMMED tracking to optimize the fstrim operation, as well as reduce "-o discard" overhead instead of keeping an active list of every allocation extent to trim:
|
| Comment by Gerrit Updater [ 11/Aug/23 ] |
|
"Li Dongyang <dongyangli@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51923 |
| Comment by Gerrit Updater [ 11/Aug/23 ] |
|
"Li Dongyang <dongyangli@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/tools/e2fsprogs/+/51924 |
| Comment by Gerrit Updater [ 29/Aug/23 ] |
|
"Andreas Dilger <adilger@whamcloud.com>" merged in patch https://review.whamcloud.com/c/tools/e2fsprogs/+/51924/ |