Abstract
In modern solid-state drives (SSDs), the indexing of flash pages is a critical component in their storage controllers. It not only affects the data access performance, but also determines the efficiency of the precious in-device DRAM resource. A variety of address mapping schemes and optimization techniques have been proposed. However, most of them were developed with human-driven heuristics. They cannot automatically capture diverse data access patterns at runtime in SSD controllers, which leaves a large room for improvement. In this paper, we present a learning-based flash translation layer (FTL), named LeaFTL, which learns the address mapping to tolerate dynamic data access patterns via linear regression at runtime. By grouping a large set of mapping entries into a learned segment, it significantly reduces the memory footprint of the address mapping table, which further benefits the data caching in SSD controllers. LeaFTL also employs various optimization techniques, including out-of-band metadata verification to tolerate mispredictions, optimized flash allocation, and dynamic compaction of learned index segments. We implement LeaFTL with an SSD simulator and evaluate it with various storage workloads. LeaFTL saves the memory consumption of the mapping table by 2.9x on average and improves the storage performance by 1.4x on average, in comparison with state-of-the-art FTL schemes.
Introduction
As solid-state drive (SSD) capacities continue to scale into the tens of terabytes, the Flash Translation Layer (FTL) faces a significant challenge: the "DRAM wall." The FTL is responsible for mapping Logical Page Addresses (LPAs) from the host operating system to Physical Page Addresses (PPAs) on the flash media. To maintain high performance, modern SSDs typically employ page-level mapping, which requires a massive mapping table stored in the controller's internal DRAM.
However, SSD controllers operate under strict power and cost constraints, making it difficult to scale internal DRAM alongside flash capacity. Traditional solutions, such as demand-based caching (e.g., DFTL), only keep a portion of the mapping table in DRAM, but this often results in frequent, high-latency flash accesses just to retrieve mapping entries. LeaFTL addresses this bottleneck by replacing rigid, heuristic-based mapping tables with a flexible, learning-based approach that uses piecewise linear regression to compress the address space.
The LeaFTL Architecture
The core innovation of LeaFTL is the use of piecewise linear regression to represent address mappings. Instead of storing an individual entry for every logical page, LeaFTL groups contiguous or strided mappings into "learned segments."
Learned Segments
A segment in LeaFTL is represented by a simple linear formula: $PPA = \lceil K \times LPA + I \rceil$. By storing only the slope ($K$), intercept ($I$), starting LPA, and segment length, the controller can represent hundreds of mapping entries in just 8 bytes. LeaFTL supports two types of segments:
- Accurate Segments: These provide 100% correct mapping predictions.
- Approximate Segments: These allow for a small error bound to increase the compression ratio, relying on secondary verification mechanisms.
Error Tolerance via OOB Verification
To handle potential mispredictions in approximate segments without incurring additional latency, LeaFTL leverages the Out-of-Band (OOB) area. Every physical flash page includes a small extra space (typically 64–256 bytes) used for metadata. LeaFTL stores "reverse mappings" in this area. During a read operation, the controller uses the predicted PPA to access the flash and simultaneously verifies the LPA in the OOB area. If a misprediction occurs, the controller can correct the address during the same flash cycle, turning a potential machine learning downside into a negligible overhead.
System Optimizations
Because SSDs perform out-of-place writes, mapping entries are highly dynamic. LeaFTL manages these changes through several key optimizations:
- Log-Structured Management: Similar to an LSM-tree, LeaFTL manages learned segments in a multi-level structure. New mappings are appended to the top level, and older segments are compacted over time to maintain efficiency.
- Write Sorting: To maximize the "learnability" of data, LeaFTL reorders the write buffer by LPA before flushing data to the flash. This simple sorting step transforms chaotic mapping patterns into highly linear, predictable sequences that are easily captured by linear models.
- Dynamic Compaction: The system continuously merges and optimizes segments to ensure the DRAM footprint remains minimal even as data is updated.
Evaluation and Results
The authors evaluated LeaFTL using the WiscSim simulator and a 1TB open-channel SSD prototype. The workloads included enterprise traces from MSR Cambridge and FIU, as well as application benchmarks like FileBench and BenchBase (running TPCC and AuctionMark on MySQL).
Key Findings
- Memory Efficiency: LeaFTL reduced mapping table size by 7.5× to 37.7× compared to standard page-level mapping (DFTL) and by 2.9× on average compared to spatial-locality schemes like SFTL.
- Performance Gains: By drastically reducing the DRAM required for indexing, more memory becomes available for data caching. This led to a 1.4× average performance improvement, with peaks up to 4.9× in specific workloads.
- Minimal Overhead: The learning process is computationally lightweight, adding only 0.02% to flash write latency. Lookup times remain extremely fast, ranging between 40 and 67 nanoseconds.
Conclusion and Future Work
LeaFTL demonstrates that machine learning models, specifically piecewise linear regression, can effectively replace traditional data structures in resource-constrained environments like SSD controllers. By exploiting the natural linearity of flash writes and utilizing existing hardware features like the OOB area, LeaFTL achieves significant memory savings and performance boosts.
While highly effective, future challenges remain. Reconstructing learned segments after a power failure can be time-consuming (~15.8 minutes for a 1TB drive), and extremely random write workloads can reduce the compression efficiency. Future research may explore hardware acceleration for more complex models and further optimizations for recovery speed in ultra-high-capacity drives.
Summary updated