而對 HitStat 以及 BPLRU 來說,使用 Padding 能夠讓效能改善的幅度較大,但 是過度的 Padding 設定反而會拖累效能,因為對含資料量小的 victim Group 做 Padding代表需要做大量額外的 Page 讀寫,這是造成圖中的 Padding 設定如果接近 0時 Elapsed Time 會迅速升高的原因,其中 FAB、BPLRU 由於這類 victim Group 比 例較多所以這種情況更明顯。因此如何達到最佳的 Padding 設定是一個重要的問 題,HitStat 使用 Padding Model 在 BAST(表 5)和 FAST(表 6)中都能夠動態的趨 近到最佳 Padding 設定,而在圖 21 可以看到 BPLRU 也可以使用 Padding Model 來 做 dynamic Padding,跟各種 Fixed Padding 設定所能達到的最低 Elapsed Time 幾乎 一致,表示 Padding Model 也適用於其它同樣以 Group 方式來管理的 Buffer 演算法。
因為 Padding Model 能夠在不同的 Buffer size 和 Log Block 數量環境下動態決定 Padding條件來達到最佳的效能,這也是在圖 19, 20 中大部份情況下,HitStat 能夠 得到最低的 Elapsed Time 而大幅勝出 FAB、BPLRU 的原因之一。
六 六 六
六、 、 、 、Conclusion
隨著 Multi Thread 以及多方面的軟體應用,Host 端跑的應用程式愈來愈多樣,
造成寫到硬碟的 workload 也愈來愈複雜。SSD 把資料儲存在 NAND Flash Memory 中,而由於採用 outplace-update 所以在寫入資料時可能會因為閒置空間不夠而觸 發 GC,在寫入愈 random 的資料時回收 invalid 資料代價愈高,導致愈慢的寫入效 能,這是 SSD 在一般應用上的效能瓶頸。
用 write Buffer 或較複雜的 NFTL mapping 方式都可以試圖改善寫入的效能瓶 頸,但重新設計複雜的 NFTL 演算法極有可能產生出其它方面的問題。而使用 write Buffer也需要注意因為突然斷電造成資料遺失的問題,在一般桌上型或者伺服器電 腦的應用上可能會導致整個 File System 損壞。而目前有兩個方法可以解決這個問
32
題,第一個方法為使用電容延緩 SSD 的關閉時間,這段時間需要足夠把 Buffer 內 的資料寫到 NAND Flash Memory 的固定位置上;而另一個方法為使用 Non-Volatile RAM(NVRAM)來避免 write Buffer 中的資料遺失,在最近發表的 4-state MLC
(Multi-Level Cell)PRAM[18]以及[9]中的介紹,我們可以期待使用 NVRAM write Buffer的 SSD 產品問市。
既有應用於 Flash Storage 上的 Buffer 管理演算法,FAB 的 replacement policy 著重空間區域性,只適用於 Log Block 主要能吸收時間區域性的 NFTL 如 BAST;而 BPLRU的 replacement policy 著重時間區域性,只適用於 Log Block 主要能吸收空間 區域性的 NFTL 如 FAST。即使有 Log Block 的幫助,但它們由於過份注重單一特性,
會造成某些資料霸佔住 Buffer 空間而排擠到另一種特性的資料留在 Buffer 中,使 Buffer能發揮的效能有限。
此篇論文提出的 Buffer 管理演算法 Hit Statistic(HitStat),使用隨 workload 動 態調整的 Cost-Benefit Analysis,同時考量時間區域性和空間區域性來最大化 Group Hit Ratio,能夠把許多小的 random write request 轉變成大的 sequential write 再寫到 NFTL,改善 SSD 主要因為 random write 導致的效能下降問題,也解決了既有方法 的問題以及侷限性,能適用於各種不同的 NFTL。實驗結果在 32MB 的 Buffer size、
512KB的 Block size 下,HitStat 的 flushed Groups 數量為 FAB 的 58.1%、BPLRU 的 71.3%。適當的 Padding 可以把部份資料做 Switch Merge 而不佔住 Log Block 的空間,
能夠有效減少 Full Merge 的代價來改善 SSD 的整體效能,但過度的 Padding 由於沒 有充分利用到 Log Block 的空間反而使效能更差。所以除了 Buffer replacement policy 外,我們也提出 Padding Model 可以在不同 Buffer size、不同 Log Block 數量環境下 動態決定做 Padding 的條件,能夠趨近於用 off-line 方式得到的最佳設定使效能達 到最高,Padding Model 也能夠應用到其它的 Buffer 管理演算法。實驗結果在 32MB 的 Buffer size、4K512KB 的 Page Block size、NFTL 為 BAST 使用 2048 個 Log Block 的 設定下,使用 Padding Model 動態決定 Padding 條件的 HitStat 其寫入效能為 FAB 的 113.9%、BPLRU 的 128.0%;而在 NFTL 為 FAST 使用 128 個 Log Block 的設定下,
HitStat(adj)的寫入效能為 FAB 的 133.2%、BPLRU 的 138.6%,除了比既有的 Buffer 管理演算法更大幅度改善 SSD 的寫入效能外,也能夠適用於各種的 NFTL 架構。
33
參 考 文 獻
1. Aayush, G., K. Youngjae, and U. Bhuvan, DFTL: a flash translation layer
employing demand-based selective caching of page-level address mappings, in Proceeding of the 14th international conference on Architectural support for programming languages and operating systems. 2009, ACM: Washington, DC, USA.
2. Heeseung, J., et al., FAB: flash-aware buffer management policy for portable media players. Consumer Electronics, IEEE Transactions on, 2006. 52(2): p.
485-493.
3. Hyojun, K. and A. Seongjun, BPLRU: a buffer management scheme for improving random writes in flash storage, in Proceedings of the 6th USENIX Conference on File and Storage Technologies. 2008, USENIX Association: San Jose, California.
4. Hyojun, K., et al., A Page Padding Method for Fragmented Flash Storage Lecture Notes in Computer Science, 2007. 4705: p. 164-177.
5. Jesung, K., et al., A space-efficient flash translation layer for CompactFlash systems. Consumer Electronics, IEEE Transactions on, 2002. 48(2): p. 366-375.
6. Jeong-Uk, K., et al., A superblock-based flash translation layer for NAND flash memory, in Proceedings of the 6th ACM & IEEE International conference on Embedded software. 2006, ACM: Seoul, Korea.
7. Sang-Won, L., et al., A log buffer-based flash translation layer using
fully-associative sector translation. ACM Trans. Embed. Comput. Syst., 2007.
6(3): p. 18.
8. Sungjin, L., et al., LAST: locality-aware sector translation for NAND flash
memory-based storage systems. SIGOPS Oper. Syst. Rev., 2008. 42(6): p. 36-42.
9. Sooyong, K., et al., Performance Trade-Offs in Using NVRAM Write Buffer for Flash Memory-Based Storage Devices. IEEE Trans. Comput., 2009. 58(6): p.
744-758.
10. Yong-Goo, L., et al., μ-FTL: a memory-efficient flash translation layer supporting multiple mapping granularities, in Proceedings of the 8th ACM international conference on Embedded software. 2008, ACM: Atlanta, GA, USA.
11. Song, J., et al., DULO: an effective buffer cache management scheme to exploit both temporal and spatial locality, in Proceedings of the 4th conference on USENIX Conference on File and Storage Technologies - Volume 4. 2005, USENIX Association: San Francisco, CA.
12. Seon-yeong, P., et al., CFLRU: a replacement algorithm for flash memory, in Proceedings of the 2006 international conference on Compilers, architecture and synthesis for embedded systems. 2006, ACM: Seoul, Korea.
13. Michael, R.G. and S.J. David, Computers and Intractability: A Guide to the Theory of NP-Completeness. 1979: W. H. Freeman & Co. 338.
14. K9F1208U0C 64M x 8 Bits NAND Flash Memory Data Sheet. Samsung Electronics Company, 2006.
15. K9NBG08U5M 1G x 8 Bit / 2G x 8 Bit / 4G x 8 Bit NAND Flash Memory Data Sheet. Samsung Electronics Company, 2005.
16. K9GAG08U0M 1G x 8 Bit / 2G x 8 Bit NAND Flash Memory Data Sheet (Preliminary). Samsung Electronics Company, 2006.
17. Russinovich, M., DiskMon for Windows v2.01. 2006.
18. Bedeschi, F., et al. A Multi-Level-Cell Bipolar-Selected Phase-Change Memory. in
34
Solid-State Circuits Conference, 2008. ISSCC 2008. Digest of Technical Papers.
IEEE International. 2008.