Digital Independence with the Immich 3.0 Update
Unleashing PCIe Gen5 Performance in Linux

The performance gap in high-speed SSDs manifests most acutely during random 4KB block reads. In such scenarios, a paradox emerges: while the physical storage medium is capable of processing millions of operations per second, the CPU becomes the primary bottleneck. Performance analysis reveals that the Linux kernel consumes excessive resources on service overhead before data transmission from the disk actually begins.
The primary source of this latency is the iomap subsystem. This component of the kernel is responsible for mapping logical file addresses to physical blocks on the drive when utilizing Direct I/O. In standard operation, the CPU must manage a complex state machine and constantly allocate memory for temporary service structures. When the system is hit with a massive stream of small requests, this overhead begins to dominate actual data processing, throttling the overall system throughput.

To address this, a "simple dio path" concept has been developed. The essence of this optimization is the creation of an "express lane" for requests that meet specific security and simplicity criteria. If an operation is read-only, the data volume does not exceed the filesystem block size (typically 4KB), the file is unencrypted, and it resides on a supported filesystem (EXT4 or XFS), the kernel completely bypasses the heavyweight iomap state machine.
This approach minimizes computational latency by routing the request through the shortest possible path down the I/O stack, eliminating the need for dynamic memory allocation. It transforms the processing sequence from a multi-stage bureaucratic cycle into a streamlined data flow.
The impact of this mechanism is particularly evident when paired with io_uring—Linux's modern asynchronous I/O interface that radically reduces the number of system calls. In tandem with the optimized iomap path, performance on EXT4 and XFS filesystems shows an impressive leap: random 4KB read metrics increased from 1.92 million to 2.19 million IOPS. While a 14% gain may seem modest at first glance, for high-load servers and databases, such a difference translates into a massive reduction in latency and significantly improved system responsiveness.
Currently, the relevant patches have passed the peer-review stage and have been integrated into specialized VFS development branches. The final pull request is expected to be merged into the mainline kernel during the Linux 7.3 merge window. If development stays on schedule, users will gain access to these optimizations by the end of the year, finally unlocking the full potential of the latest generation of consumer and enterprise NVMe drives.

