Linux 6.15’s exFAT file deletion performance boosted
A recent development in the upcoming Linux 6.15 kernel has been spotted, because there was a big improvement to the exFAT file system implementation in relation to how it deletes the files when the “discard
” mount option is used. This improvement significantly saves time as a test file after the merge has been deleted in 1.6 seconds, compared to more than 4 minutes of the total time taken.
This pull request makes sure that, upon file deletion, it discards a group of contiguous clusters (that is, clusters that are next to each other) in batch instead of discarding them one by one. This was because in prior kernels, such as 6.14, “if the discard mount option is enabled, the file’s clusters are discarded when they are freed. Discarding clusters one by one will significantly reduce performance. Poor performance may cause soft lockup when lots of clusters are freed.”
The change has been introduced in commit a36e0ab. Since then, the pull request has been merged to the kernel and it will be integrated to the first release candidate of Linux 6.15. A simple performance benchmark has been verified with the following commands:
# truncate -s 80G /mnt/file# time rm /mnt/file
In detail, the performance of this filesystem without this commit is poor, totalling about 4 minutes and 46 seconds in real time, with 12 seconds of system time. In contrast to the patched kernel, it totals about 1 second in real time, with 17 milliseconds of system time.
It’s a huge improvement!
Image by diana.grytsku on Freepik