Optimizing Trim Commands to Improve Flash Storage Performance in Embedded Systems
June 14, 2017
Proper upkeep of NAND flash is critical to the performance and life expectancy of solid state drives (SSDs), embedded multimedia cards (eMMCs), and universal Flash storage (UFS) devices. Part of this maintenance is routine discards (or “trim,” “unmap,” or “erase” commands in non-Linux command sets).
But discards are not free – they have associated performance penalties, and most flash transition layers (FTLs) must write a record to indicate a sector has been discarded. Especially in embedded systems where each cell counts, smaller discards can use more memory than they remove, or even truncate, delete, or overwrite crucial files.
The following describes how embedded engineers working with Linux and RTOS file systems can make the most out of discard commands to improve performance and visibility in flash storage devices.