提出一种基于闪存硬盘(solid state disk,简称SSD)的自适应缓冲区管理算法CBLRU,其将数据页的置换代价与其驻留内存的影响相结合,为每个数据页附加一个权值,当发生页缺失问题时,选择具有最小权值的数据页进行置换,从而可以在延长修改页驻留缓冲区的同时,避免某些修改页长期占用缓冲区中有效空间问题的发生.由于该权值会根据不同闪存的读写代价进行动态调整,因此可适用于不同类型的闪存硬盘:进一步,提出了同类型数据页的权重关系稳定性结论,基于该结论,CBLRU将缓冲区中的数据页组织为两个LRU队列,分别用于管理只读页和修改页,从而将内存的CPU操作代价从O(klogk)降低为O(1).基于不同闪存硬盘和不同存取模式的实验结果说明,CBLRU可有效应用于不同类型的闪存硬盘,且综合性能优于已有方法.
Different from existing flash-aware buffer replacement policies that focus on the asymmetry of read and write operations, this paper addresses the "discrepancy" of the asymmetry for different flash disks which has existed for a long time. The study proposes an adaptive replacement policy (CBLRU), which assigns to each page a weighted value that combines the IO cost and the influence of pages staying in the buffer. When selecting a victim page, the one with the minimum weighted value will be selected as the victim page, thus, one can avoid the problem of occupying the valid buffer space by dirty pages that are not used for a long time. Moreover, as the cost of read and write operations will be adjusted according to different flash disks, CBLRU can wisely tune itself and adapt to different kinds of flash disks. Finally, a theorem is proposed addressing the stability of the relationship between pages, based on which CBLRU organizes all data pages into two LRU lists: one for clean pages and the other for dirty pages, and then the CPU complexity is reduced form O(klogk) to O(1). The experimental results show that compared with existing buffer-aware replacement algorithms, CBLRU is very efficient when being used for different kinds of flash disks.