Skip to main content

Flash Translation Layer

The FTL manages the LBA lookup table (LUT). It uses the LUT to translate LBA-based block I/O into SEF API flash address-based I/O on behalf of the block layer. It also processes events from the SEF Library to keep the LUT and Super Block state up to date as user I/O and GC I/O complete. The FTL keeps the LUT in DRAM, only persisting it when the block layer is closed. The LUT uses 8 bytes of DRAM for each LBA and is by far the largest consumer of DRAM with 2GiB required for a 1TiB QoS Domain. It can be reconstructed or repaired from the written user data in the case of an unclean shutdown.

The FTL exposes functions to update and use the LUT. SFTLookupForRead() returns the flash address for a given LBA. The call will fail if the owning Super Block is not in the Open or Closed state. Additionally, it increments the reader count for the Super Block. This prevents the Super Block from being released until SFTReleaseForRead() is called. When the Super Block is known to have a non-zero reader count, SFTLookup() can be used, which does not modify the reader count or validate the Super Block is in a state where reads are allowed. Entries are placed in the LUT using SFTSet() and SFTUpdate(). SFTSet() is the authoritative way to update the LUT. It overwrites whatever is in the LUT entry for a given LBA, whereas SFTUpdate() will only update when the current entry is unchanged.

The FTL also includes the function SFTRebuildLut() that can be used to validate or repair the LUT. It can be invoked with SEF-CLI in the case of an unclean shutdown or to rebuild the LUT after a domain has been restored from a backup.