The exFAT file system is about to get faster in Linux 6.2, at least when creating files and directories, with the performance boost especially noticeable on low-end processors.
Microsoft released the exFAT specification and announced Linux support in August 2019, which was followed by a new exFAT implementation in Linux 5.7 (June 2020) from Samsung. But people are still working on improving exFAT Linux support, and Yuezhang Mo, an engineer at Sony, committed a patchset for Linux 6.2 that reduces repeated traversal of directory entries to boost the performance of exFAT:
After traversing all directory entries, hint the empty directory entry no matter whether or not there are enough empty directory entries.
After this commit, hint the empty directory entries like this:
1. Hint the deleted directory entries if enough;
2. Hint the deleted and unused directory entries which at the end of the cluster chain no matter whether enough or not (Add by this commit);
3. If no any empty directory entries, hint the empty directory entries in the new cluster(Add by this commit).
This avoids repeated traversal of directory entries, reduces CPU usage, and improves the performance of creating files and directories(especially on low-performance CPUs).
Yuezhang tested the patch on an NXP i.MX6 platform (i.MX6q SABRE Lite development board) using a Class 4 MicroSD card and found improvements from 14.4% to 57.4% depending on many new files were created using the following code:
for ((i=0;i<5;i++)); do
time (for ((j=1;j<=1000;j++)); do touch file$((i*1000+j)); done)
|Number of files||Before||After||Improvement|
So basically the more files are created the better the relative performance, and this can be noticeable by the user has the new patch saves about 27 seconds when creating 5,000 files on this specific platform.
Via Phoronix and Neowin. Thanks to TLS for the tip.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
3 Replies to “Linux 6.2 exFAT update to improve performance when creating files and directories”
> So basically the more files are created the better the relative performance
Huh? The more files created the bigger the absolute time saved which is a no-brainer. The relative ‘performance’ would need to take the amount of files created into account (dividing through this) and then it looks like this:
Whether this is a ‘trend’ showing lower relative performance at higher count of files or just results variation is irrelevant since a class 4 SD card is so crappy wrt random I/O performance that repeating the test with something reasonable (be it even the cheapest A1 rated SD card possible) will show no differences anyway.
I used “relative” with regard to percentage gains as the more you create files the longer it takes.
Reliability is the main issue for me. But I have had more success as I learned more. Flash filesystems are SBC’s weak point,IMHO