计算机科学与探索 ›› 2021, Vol. 15 ›› Issue (1): 84-95.DOI: 10.3778/j.issn.1673-9418.2003014

• 系统软件与软件工程 • 上一篇    下一篇

利用页面重构与数据温度识别的闪存缓存算法

曾祥伟,邓玉辉   

  1. 1. 暨南大学 信息科学技术学院,广州 510632
    2. 中国科学院 计算技术研究所 计算机体系结构国家重点实验室,北京 100190
  • 出版日期:2021-01-01 发布日期:2021-01-07

Constructing Cache Algorithm for Flash by Leveraging Page Reconstruction and Data Temperature Recognition

ZENG Xiangwei, DENG Yuhui   

  1. 1. School of Information Science and Technology, Jinan University, Guangzhou 510632, China
    2. State Key Laboratory of Computer Architecture, Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China
  • Online:2021-01-01 Published:2021-01-07

摘要:

基于闪存的固态盘(SSD)具有比磁盘更加优越的性能,并且在桌面系统中逐渐替代磁盘。但是,尽管在SSD中嵌入了DRAM作为缓存,闪存在不断写入的过程中也可能产生不稳定的写性能,主要是因为逻辑页写入时会频繁引发非覆盖写和垃圾回收操作。针对此问题,提出了一种叫作PRLRU的新型闪存缓存管理方法,通过页面重构机制以及数据温度识别机制来管理缓存区。页面重构机制把即将回写的有效数据未满一个整页大小的页与多个其他有效数据不足一个页大小的页进行数据重组后再回写至闪存,通过尽可能减少非覆盖写操作来达到减少实际写操作的目的。数据温度识别机制通过对缓存页进行温度等级标记,按预定优先级顺序回写缓存页。对真实负载进行测试,实验结果表明,PRLRU能够有效提高SSD性能并延长SSD使用寿命,与LRU、BPLRU和2QW-Clock三种算法相比,写性能平均分别提高了34.5%、22.8%和28.8%,读性能平均分别提高了12.5%、10.6%和8.3%,垃圾回收数量平均分别降低了10.5%、8.7%和6.3%。

关键词: 闪存, 非覆盖写, 垃圾回收, 页面重构, 数据温度识别

Abstract:

NAND flash based solid state disks (SSD) have better performance than magnetic disks and are gradually replacing hard disks in desktop systems. However, although DRAM is embedded in SSD as a buffer, SSD may also produce unstable write performance with continuous writing, because non-overwrite write and garbage collection(GC) operations are frequently triggered when physical pages are written. Aiming at this problem, a new flash buffer management strategy called PRLRU (least recently used algorithm by page reconstruction) is proposed, which manages the buffer through the page reconstruction mechanism and the data temperature recognition mechanism. The page reconfiguration mechanism combines pages with valid data that are less than one page size with other pages and then writes back to the flash memory to reduce the actual write operation by minimizing the number of non-overwrite write operations. The data temperature recognition mechanism performs temperature level marking on the cached pages, and then writes back the pages in a predetermined priority order. Test it with real workloads, the experimental results show that PRLRU can effectively improve SSD performance and prolong SSD lifetime. Compared with LRU, BPLRU and 2QW-Clock, the write performance of PRLRU is increased by 34.5%, 22.8% and 28.8%, respectively on average, the read performance increased by 12.5%, 10.6% and 8.3%, respectively on average, and the amount of garbage collection decreased by 10.5%, 8.7% and 6.3%, respectively on average.

Key words: flash, non-overwrite write operation, garbage collection operation, page reconstruction, data temperature identification