Microsoft’s exFAT Performance Boost on Linux Thanks to Sony

Microsoft’s exFAT Performance Boost on Linux Thanks to Sony

Enhancements in exFAT Performance: A Decade of Innovations

In 2012, Microsoft introduced the 64-bit version of its Extended File Allocation Table (exFAT), which served as a modern replacement for the older 32-bit FAT32 file system. The company took a significant step further in 2019 by announcing native support for the exFAT format on Linux platforms, marking a key moment in the evolution of file system interoperability.

Recent advancements have emerged, particularly thanks to the contributions of Sony engineer Yuezhang Mo. In 2022, Mo discovered that optimizing directory entry traversal could enhance exFAT performance by an impressive 57%.This pivotal improvement was integrated into Linux kernel version 6.2, showcasing the ongoing evolution of file system technology.

Latest Developments in exFAT Optimization

Mo has returned with further enhancements in a recent pull request aimed at refining the exFAT file system. The proposed changes include several key improvements that not only enhance performance but also resolve existing issues. Here’s a summary of the enhancements included in this latest submission:

Description for this pull request:

  • Address random stack corruption and rectifying errors in exfat_get_block().
  • Enhance exfat_get_block() by optimizing for edge cases.
  • Fix an infinite loop issue related to self-linked chains in exfat_find_last_cluster.
  • Eliminate obsolete EXFAT_CLUSTERS_UNTRACKED codes.
  • Add essential checks during shutdown.
  • Boost delete performance when using the discard mount option.

The “discard mount”option plays a crucial role in performance improvement. It enables the file system to communicate with the storage device to indicate which blocks are no longer needed. This real-time notification allows for efficient management of free space, helping to streamline operations and enhance overall file system efficiency.

The patch clarifies:

If the discard mount option is enabled, freed clusters are discarded promptly. Processing clusters on a one-by-one basis can degrade performance, causing potential soft lockups when a large number of clusters are freed. This update enhances performance by batching the discard operation of contiguous clusters.

Performance Metrics: A Dramatic Improvement

The performance uplift from these enhancements is remarkable. Testing involved a substantial 80 GB file, which previously required approximately 4 minutes and 46 seconds to delete. After implementing the new optimizations, the deletion time plummeted to under 2 seconds, achieving a staggering performance improvement of 172 times.

Performance measurements reveal:

# truncate -s 80G /mnt/file

#time rm /mnt/file

Without this commit:

  • real 4m46.183s
  • user 0m0.000s
  • sys 0m12.863s

With this commit:

  • real 0m1.661s
  • user 0m0.000s
  • sys 0m0.017s

For further details on this pull request, you can check it out on the Linux Kernel Mailing List (LKML).

For additional insights into these performance enhancements, you can visit the source article.

Leave a Reply

Your email address will not be published. Required fields are marked *