# 闪存控制器

闪存控制器是闪存存储设备（如SSD、存储卡或嵌入式模块）内部的处理器和固件，负责管理NAND闪存介质，并将其作为简单的可重写块设备呈现给主机。由于NAND闪存不能原地覆写、每次擦除都会造成磨损，并且会产生随使用而增多的位错误，控制器运行闪存转换层（FTL），在幕后执行异地更新、[磨损均衡](https://www.edgepedia.org/zh/wear-leveling)和垃圾回收，同时虚拟化物理地址空间<sup>[1](https://arxiv.org/abs/1504.01666)</sup>。

| 关键事实 | 详情 |
|---|---|
| 核心功能 | 地址映射、垃圾回收、磨损均衡、坏块管理和纠错，全部由控制器运行的FTL固件实现<sup>[2](https://www.sciencedirect.com/science/article/pii/S0065245819300117)</sup> |
| 映射表开销 | 一块2 TB SSD的完整页级映射表按每项4字节计算约需1 GB SRAM，因此控制器在RAM中缓存热条目，并将完整映射表保存在闪存中<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup> |
| 写放大 | 垃圾回收会强制产生额外的物理写入；写放大系数（WAF）即SSD总写入量与主机写入量之比，理想值为1<sup>[4](https://semiconductor.samsung.com/news-events/tech-blog/a-brief-history-of-data-placement-technologies/)</sup> |
| 纠错 | 随着NAND密度提升，BCH码变得不够用；控制器转向LDPC码，企业级控制器已采用16 KB LDPC码字<sup>[5](https://www.usenix.org/conference/fast13/technical-sessions/presentation/zhao)</sup><sup> • </sup><sup>[6](https://www.tomshardware.com/pc-components/ssds/smis-pcie-6-0-ssd-controller-for-consumer-ssds-coming-next-year-but-severe-nand-shortages-will-get-even-worse-in-2027-as-ai-data-centers-swallow-supply-an-interview-with-silicon-motions-svp-nelson-duann)</sup> |
| 无DRAM设计 | 低成本控制器省略板载DRAM，并使用NVMe主机内存缓冲区（HMB）将映射表缓存在系统RAM中；三星（Samsung）SSD 980请求64 MB主机内存，最低可在16 MB下工作<sup>[7](https://www.arritaintl.com/news-information-details.html?id=2)</sup> |
| 主机管理的替代方案 | 开放通道SSD（Open-Channel SSD）将盘内部并行性暴露给主机，由主机接管数据放置、I/O调度和垃圾回收，而控制器保留错误处理、擦洗和磨损均衡<sup>[8](https://openchannelssd.readthedocs.io/)</sup> |

## 为什么闪存需要控制器

NAND闪存施加了一些块设备接口不会显示的约束。读写以页为单位，通常为4至16 KB；页必须在块内顺序写入；任何更新都必须先擦除；而擦除只能以整块为粒度进行。每个块也只能承受有限次数的编程/擦除循环，之后就会变得错误频发，无法可靠存储数据。这三种操作的延迟高度不对称：页读取、页写入和擦除分别约为数十、数百和数千微秒<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。FTL将这一切隐藏起来：当逻辑页被更新时，新版本会写入不同的物理位置，而旧副本（前像）被标记为无效<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。

## 地址映射

映射表将来自主机的逻辑地址转换为闪存中的物理页。一种简单的实现是驻留RAM的数组，每个逻辑页对应一个条目，但闪存设备只带有适量SRAM，映射表放不下：一块2 TB SSD按每项4字节计算约需1 GB SRAM，而SRAM每兆字节成本约5美元，比DRAM高约两个数量级<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。

**映射方案以内存换性能。** 早期设计限制灵活性以降低RAM占用：大多数块采用块映射，少量页映射的日志块吸收更新，二者之间的合并通常导致每次页更新产生2倍的写放大<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。以DFTL为开端的最先进范式将完全页关联映射存储在闪存中，并在SRAM中保留一个小的热条目LRU缓存；这消除了合并操作，但增加了缓存未命中读取和同步写入<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。尽管页级映射占用的内存更大，现代SSD仍普遍采用它，因为它提供直接的逻辑到物理查找<sup>[9](https://jianh.web.engr.illinois.edu/papers/leaftl-asplos2023.pdf)</sup>。

## 垃圾回收与写放大

由于更新采用异地写入，块中会积累过期页。垃圾回收选择有效页较少的牺牲块，将仍然有效的页迁移到空闲块，然后擦除这些牺牲块<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。由此产生的额外写入用写放大系数来量化，即SSD总写入量与主机总写入量之比；会使整块失效的顺序主机工作负载可实现WAF为1，而随机写入会混合有效页和无效页，推高WAF<sup>[4](https://semiconductor.samsung.com/news-events/tech-blog/a-brief-history-of-data-placement-technologies/)</sup>。在造成写放大的所有因素中，垃圾回收迁移通常影响最大<sup>[3](https://patents.google.com/patent/US20170249257A1/en)</sup>。

## 磨损均衡

磨损均衡将擦除操作均匀分散，使所有块尽可能长时间保持可用，因为一个块在经历数千次擦除后就会达到寿命终点<sup>[10](https://scholar.nycu.edu.tw/en/publications/design-and-implementation-of-an-efficient-wear-leveling-algorithm/)</sup>。算法分为动态和静态两类：动态算法在空闲块之间轮转写入；静态算法还会将冷数据从磨损较少的块迁移到磨损较多的块，从而腾出磨损较少的块来存放频繁更新的数据<sup>[11](https://www.usenix.org/legacy/events/fast10/tech/full_papers/fast10proceedings.pdf)</sup><sup> • </sup><sup>[19](https://www.macronix.com/Lists/ApplicationNote/Attachments/1913/AN0289V1-Wear%20Leveling%20in%20NAND%20Flash%20Memory.pdf)</sup>。真实工作负载会将擦除集中在少部分块上，因此高效算法会把很少更新的数据移到磨损异常严重的块上，并避免让某个块反复参与磨损均衡活动；有一种实现仅用约200字节RAM，就在一款额定33 MHz的SSD控制器中实现了均匀磨损<sup>[10](https://scholar.nycu.edu.tw/en/publications/design-and-implementation-of-an-efficient-wear-leveling-algorithm/)</sup>。磨损均衡还可跨设备扩展：在基于SSD的RAID系统中，各块盘可能磨损不均，跨SSD磨损均衡通过分散奇偶校验条带来拉平整个阵列的耐久度<sup>[12](https://jcst.ict.ac.cn/article/doi/10.1007/s11390-013-1310-z)</sup>。

## 纠错

随着NAND容量提升、可靠性下降，传统BCH码已不够用，控制器转而采用低密度奇偶校验（LDPC）码。LDPC解码需要细粒度闪存感测，这会增加读取延迟，但集成缓解技术可将最坏情况下的读响应时间延迟从超过100%降至20%以下<sup>[5](https://www.usenix.org/conference/fast13/technical-sessions/presentation/zhao)</sup>。纠错如今是核心设计轴线：慧荣科技（Silicon Motion）维持一支专门的ECC团队，因为正如其高级副总裁尼尔森·杜安（Nelson Duann）所说，LDPC技术必须一代代进步，才能跟上NAND层数，而企业级控制器已经转向16 KB LDPC码字<sup>[6](https://www.tomshardware.com/pc-components/ssds/smis-pcie-6-0-ssd-controller-for-consumer-ssds-coming-next-year-but-severe-nand-shortages-will-get-even-worse-in-2027-as-ai-data-centers-swallow-supply-an-interview-with-silicon-motions-svp-nelson-duann)</sup>。

## DRAM、无DRAM设计与HMB

高端控制器使用DRAM缓存映射表和应用数据，但SSD内部DRAM容量受功耗和成本预算限制，因此控制器依赖按需缓存最近使用的元数据<sup>[9](https://jianh.web.engr.illinois.edu/papers/leaftl-asplos2023.pdf)</sup>。无DRAM控制器则保留一个小型SRAM缓存，并在未命中时从NAND取回映射条目，代价是一次闪存读取<sup>[13](https://www.tomshardware.com/reviews/silicon-motion-sm2263xt-controller-preview%2C5404.html)</sup>。NVMe主机内存缓冲区（HMB）让无DRAM盘使用一部分系统RAM作为映射表缓存；典型盘会请求约64 MB，也能容忍更少<sup>[7](https://www.arritaintl.com/news-information-details.html?id=2)</sup>。这种方法缩小了差距：群联电子（Phison）的E37T是一款无DRAM的PCIe 5.0控制器，基于台积电（TSMC）6 nm工艺，具备四个NAND通道，速率最高4,800 MT/s，可在功耗2.3 W下提供14.7 GB/s，相比其前代无DRAM产品性能提升38%<sup>[14](https://www.tomshardware.com/pc-components/ssds/phisons-new-ssd-controller-sips-a-mere-2-3w-and-runs-at-14-7-gb-s-addressing-pcie-5-0s-power-concerns-more-affordable-and-power-saving-pcie-5-0-drives-are-coming-for-laptops-and-gaming-handhelds)</sup>。

## 控制器产业与主机管理的闪存

闪存控制器主要由商用芯片供应商设计，包括慧荣科技、群联电子、瑞昱（Realtek）和英韧科技（InnoGrit），其芯片由SSD制造商与NAND和固件搭配。群联电子于2019年推出业界首款消费级PCIe 4.0 x4 NVMe控制器PS5016-E16<sup>[15](https://www.phison.com/ps5018-e18/)</sup>。客户之间的定制主要发生在固件层面，控制器ASIC保持不变<sup>[6](https://www.tomshardware.com/pc-components/ssds/smis-pcie-6-0-ssd-controller-for-consumer-ssds-coming-next-year-but-severe-nand-shortages-will-get-even-worse-in-2027-as-ai-data-centers-swallow-supply-an-interview-with-silicon-motions-svp-nelson-duann)</sup>。

**将工作移入主机。** 开放通道SSD颠覆了传统分工：它们将盘内部并行性暴露给主机，由主机实现数据放置、I/O调度和垃圾回收，而控制器保留以介质为中心的元数据、错误处理、擦洗和磨损均衡。这换来了租户之间的I/O隔离、可预测的延迟以及针对工作负载的优化<sup>[8](https://openchannelssd.readthedocs.io/)</sup>。后来的标准化走了折中路线：NVMe分区命名空间（ZNS）SSD要求区内顺序写入，从而保证写放大系数为1；灵活数据放置（FDP）让主机以最小集成工作量隔离数据，目标是将WAF控制在接近1<sup>[4](https://semiconductor.samsung.com/news-events/tech-blog/a-brief-history-of-data-placement-technologies/)</sup>。

## 可靠性特性

控制器还负责掉电保护和介质维护。企业级固件跟踪盘整个生命周期内的介质磨损、温度异常和错误历史，并通过标准NVMe日志页暴露这些信息，以供集群监控<sup>[16](https://www.techradar.com/pro/10-ways-enterprise-ssds-differ-from-traditional-ssds-and-why-that-matters)</sup>。发生掉电时，带保护电容的控制器会停止接受新的主机写入，并利用储存的能量将数据从传输缓冲区刷写到NAND<sup>[17](https://www.intel.com/content/dam/www/public/us/en/documents/technology-briefs/ssd-320-series-power-loss-data-protection-brief.pdf)</sup>。一些设计将写入推向介质路径更深处：闪迪（Sandisk）的UltraQLC平台让控制器将数据直接写入QLC存储介质，而非伪SLC缓冲区，从而在首次写入时就实现掉电安全<sup>[18](https://www.tomshardware.com/pc-components/ssds/sandisk-unveils-colossal-new-256tb-ssd-with-new-ultraqlc-flash-memory-enterprise-grade-ssds-for-high-density-storage-also-come-in-128tb)</sup>。

## References

1. [Niv Dayan, Philippe Bonnet (2015). Garbage Collection Techniques for Flash-Resident Page-Mapping FTLs. arXiv.](https://arxiv.org/abs/1504.01666)
2. [A comprehensive survey of issues in solid state drives. ScienceDirect.](https://www.sciencedirect.com/science/article/pii/S0065245819300117)
3. [US20170249257A1: Solid-state storage device flash translation layer. Google Patents.](https://patents.google.com/patent/US20170249257A1/en)
4. [A Brief History of Data Placement Technologies. Samsung Semiconductor.](https://semiconductor.samsung.com/news-events/tech-blog/a-brief-history-of-data-placement-technologies/)
5. [Kai Zhao et al. (2013). LDPC-in-SSD: Making Advanced Error Correction Codes Work Effectively in Solid State Drives. USENIX FAST '13.](https://www.usenix.org/conference/fast13/technical-sessions/presentation/zhao)
6. [SMI's PCIe 6.0 SSD controller interview with Nelson Duann. Tom's Hardware.](https://www.tomshardware.com/pc-components/ssds/smis-pcie-6-0-ssd-controller-for-consumer-ssds-coming-next-year-but-severe-nand-shortages-will-get-even-worse-in-2027-as-ai-data-centers-swallow-supply-an-interview-with-silicon-motions-svp-nelson-duann)
7. [ARRITA International: HMB testing of DRAM-less NVMe SSDs.](https://www.arritaintl.com/news-information-details.html?id=2)
8. [Open-Channel Solid State Drives: Introduction.](https://openchannelssd.readthedocs.io/)
9. [Jinghan Sun et al. (2023). LeaFTL: A Learning-Based Flash Translation Layer for Solid-State Drives. ASPLOS '23.](https://jianh.web.engr.illinois.edu/papers/leaftl-asplos2023.pdf)
10. [Li-Pin Chang, Chun Da Du (2009). Design and implementation of an efficient wear-leveling algorithm for solid-state-disk microcontrollers. ACM TODAES 15(1).](https://scholar.nycu.edu.tw/en/publications/design-and-implementation-of-an-efficient-wear-leveling-algorithm/)
11. [FAST '10 Proceedings: Flash Translation Layer. USENIX.](https://www.usenix.org/legacy/events/fast10/tech/full_papers/fast10proceedings.pdf)
12. [Yi-Mo Du et al. (2013). CSWL: Cross-SSD Wear-Leveling Method in SSD-Based RAID Systems. JCST 28(1).](https://jcst.ict.ac.cn/article/doi/10.1007/s11390-013-1310-z)
13. [Silicon Motion SM2263XT HMB SSD Preview. Tom's Hardware.](https://www.tomshardware.com/reviews/silicon-motion-sm2263xt-controller-preview%2C5404.html)
14. [Phison's new SSD controller sips a mere 2.3 W and runs at 14.7 GB/s. Tom's Hardware.](https://www.tomshardware.com/pc-components/ssds/phisons-new-ssd-controller-sips-a-mere-2-3w-and-runs-at-14-7-gb-s-addressing-pcie-5-0s-power-concerns-more-affordable-and-power-saving-pcie-5-0-drives-are-coming-for-laptops-and-gaming-handhelds)
15. [PS5018-E18. Phison Electronics.](https://www.phison.com/ps5018-e18/)
16. [10 ways enterprise SSDs differ from traditional SSDs. TechRadar.](https://www.techradar.com/pro/10-ways-enterprise-ssds-differ-from-traditional-ssds-and-why-that-matters)
17. [Intel SSD 320 Series Technology Brief: Power Loss Data Protection. Intel.](https://www.intel.com/content/dam/www/public/us/en/documents/technology-briefs/ssd-320-series-power-loss-data-protection-brief.pdf)
18. [Sandisk unveils 256TB SSD with UltraQLC flash memory. Tom's Hardware.](https://www.tomshardware.com/pc-components/ssds/sandisk-unveils-colossal-new-256tb-ssd-with-new-ultraqlc-flash-memory-enterprise-grade-ssds-for-high-density-storage-also-come-in-128tb)
19. [macronix.com](https://www.macronix.com/Lists/ApplicationNote/Attachments/1913/AN0289V1-Wear%20Leveling%20in%20NAND%20Flash%20Memory.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Storage devices & memory › Solid-state storage & memory modules › Solid-state drives (general & technology)

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/flash-memory-controller

English original: https://www.edgepedia.org/flash-memory-controller
