UFS File-Based Optimization Fixes for Linux: Shot Down as “Complete and Total Madness”
JEDEC recently introduced a Universal Flash Storage (UFS) extension for file-based optimizations (FBOs) to improve the performance of UFS devices. A Xiaomi engineer sent a set of Linux kernel patches to implement UFS FBO in the name of better performance, but with an almost immediate rejection by a veteran Linux kernel maintainer.
JEDEC released the UFS FBO Extension Specification in August. UFS FBO aims to address the potential degradation of device performance over time through the physical defragmentation of LBA ranges associated with specific files. The FBO specification is described on JEDEC.org.
A set of patches implementing UFS file-based optimizations was submitted today, where it was summarized with the new host requirements for functionality:
This feature expects the following host-device dialog:
1) The host has informed the device of the lba range(s) of interest. These ranges are usually associated with a specific file. It can be obtained from the iNode of the file and some offset calculations.
2) The host asks the device for the current physical fragmentation level of this file.
3) If necessary, the host asks the device to perform a defragmentation.
4) Upon successful completion of the defrag phase, the host may request the new level of file fragmentation.
But the idea that the host system has to tell the device about specific LBA ranges for files may be misconceived. Longtime Linux kernel developer — and maintainer of several areas of the kernel — Christoph Hellwig commented almost immediately:
This is completely and utterly insane. Files are a logical concept, which is not unique (reflinks, snapshot) and can change at any time (defragmentation, GC, dedup). Whoever invented this scheme is on crack and it has nothing to do in the Linux kernel
So, as things stand, these four UFS Linux fixes for file-based optimization support may struggle to integrate.