Linux 7.4 FAT32 driver gains 265x speedup via multi-cluster allocation fix
A three-line patch to Linux 7.4's FAT driver replaces repeated single-cluster allocations with batched multi-cluster allocation when pre-allocating file space, yielding up to 265x throughput improvement.
Summary
Linux 7.4 will deliver dramatic performance gains for FAT32 file-system operations thanks to a compact patch from developer Matheus Alves de Almeida. The change targets the allocation code path triggered by FALLOC_FL_KEEP_SIZE, a flag applications use to reserve disk space without altering the visible file size. Under the previous implementation, the driver performed numerous sequential single-cluster allocations, creating substantial overhead when growing files.
The merged patch, included in Andrew Morton's non-MM pull request this week, collapses these repeated operations into a single multi-cluster allocation call. Benchmarks published by Almeida demonstrate improvements reaching 265x across multiple test scenarios. The fix applies to all architectures running the FAT32 driver, benefiting embedded systems, removable media, and any workload relying on pre-allocation on FAT-formatted storage.
What changed in the FAT32 allocation path
- FALLOC_FL_KEEP_SIZE handling: The patch modifies how the FAT driver responds to pre-allocation requests that reserve disk space without updating the file's logical size, a pattern used by applications preparing large files.
- Single-cluster bottleneck: The prior implementation iterated through multiple one-cluster allocations when expanding files, generating excessive metadata operations and head-of-line blocking in the allocation table.
- Batched allocation: The replacement code performs multi-cluster allocation in a single call, amortizing FAT table update costs and eliminating the per-cluster loop overhead.
- Patch scope: The fix required only a few lines of code changed, indicating a targeted surgical correction rather than broad subsystem restructuring.
- Merge path: The change entered Linux 7.4 through the non-MM (non-memory management) pull request from maintainer Andrew Morton, following standard kernel subsystem integration.
Why it matters
For Linux distributions and embedded deployments still relying on FAT32 for SD cards, USB drives, or EFI system partitions, this improvement eliminates a long-standing performance cliff during file pre-allocation without requiring format changes or user intervention. The fix particularly benefits Steam Deck and handheld Linux devices that use FAT-formatted removable storage, as well as cross-platform development workflows where FAT32 remains the lowest-common-denominator file system.
Original reference: www.phoronix.com →