Trading Flash Translation Layer For Performance and Lifetime

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Flash storage memory and Design Trade offs for SSD performance
Kernel memory allocation
M. Mateen Yaqoob The University of Lahore Spring 2014.
FlashVM: Virtual Memory Management on Flash Mohit Saxena and Michael M. Swift Introduction Flash storage is the largest change to memory and storage systems.
International Conference on Supercomputing June 12, 2009
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Avishai Wool lecture Introduction to Systems Programming Lecture 8.3 Non-volatile Memory Flash.
Memory Management 2010.
Memory Organization.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
File System Implementation
Solid State Drive Feb 15. NAND Flash Memory Main storage component of Solid State Drive (SSD) USB Drive, cell phone, touch pad…
Operating Systems CMPSC 473 I/O Management (2) December Lecture 24 Instructor: Bhuvan Urgaonkar.
Hot and Cold Data Identification -Applications to Storage Devices and Systems- Dongchul Park Computer Science and Engineering July 16, 2012 Advisor: Professor.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Flash memory Yi-Chang Li
Origianal Work Of Hyojun Kim and Seongjun Ahn
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Operating Systems Chapter 8
Embedded System Lab. 서동화 HIOS: A Host Interface I/O Scheduler for Solid State Disk.
Speaker: 吳晋賢 (Chin-Hsien Wu) Embedded Computing and Applications Lab Department of Electronic Engineering National Taiwan University of Science and Technology,
The Memory Hierarchy 21/05/2009Lecture 32_CA&O_Engr Umbreen Sabir.
Computer Architecture Memory organization. Types of Memory Cache Memory Serves as a buffer for frequently accessed data Small  High Cost RAM (Main Memory)
DFTL: A flash translation layer employing demand-based selective caching of page-level address mappings A. gupta, Y. Kim, B. Urgaonkar, Penn State ASPLOS.
Design of Flash-Based DBMS: An In-Page Logging Approach Sang-Won Lee and Bongki Moon Presented by Chris Homan.
Embedded System Lab. Jung Young Jin The Design and Implementation of a Log-Structured File System D. Ma, J. Feng, and G. Li. LazyFTL:
Chapter 4 Memory Management Virtual Memory.
Virtual Memory Virtual Memory is created to solve difficult memory management problems Data fragmentation in physical memory: Reuses blocks of memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Design of Flash-Based DBMS: An In-Page Logging Approach Sang-Won Lee and Bongki Moon Presented by RuBao Li, Zinan Li.
Virtual Memory 1 1.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Operating Systems CMPSC 473 I/O Management (3) December 07, Lecture 24 Instructor: Bhuvan Urgaonkar.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
A Lightweight Transactional Design in Flash-based SSDs to Support Flexible Transactions Youyou Lu 1, Jiwu Shu 1, Jia Guo 1, Shuai Li 1, Onur Mutlu 2 LightTx:
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
Lecture 22 SSD. LFS review Good for …? Bad for …? How to write in LFS? How to read in LFS?
ExLRU : A Unified Write Buffer Cache Management for Flash Memory EMSOFT '11 Liang Shi 1,2, Jianhua Li 1,2, Chun Jason Xue 1, Chengmo Yang 3 and Xuehai.
Sungkyunkwan University Sector Level Mappinng FTL Computer engineering, Sungkyunkwan Univ. Oh Gihwan, Han Gyuhwa, Hong Gyeonghwan Jasmine Open-SSD Project.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
 The emerged flash-memory based solid state drives (SSDs) have rapidly replaced the traditional hard disk drives (HDDs) in many applications.  Characteristics.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Chin-Hsien Wu & Tei-Wei Kuo
Solid State Disk Prof. Moinuddin Qureshi Georgia Tech.
Virtual Memory Chapter 8.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Virtual Memory Chapter 7.4.
Chapter 2 Memory and process management
File-System Implementation
Parallel-DFTL: A Flash Translation Layer that Exploits Internal Parallelism in Solid State Drives Wei Xie1 , Yong Chen1 and Philip C. Roth2 1. Texas Tech.
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
An Adaptive Data Separation Aware FTL for Improving the Garbage Collection Efficiency of Solid State Drives Wei Xie and Yong Chen Texas Tech University.
HashKV: Enabling Efficient Updates in KV Storage via Hashing
Chapter 9: Virtual-Memory Management
Segmentation Lecture November 2018.
Main Memory Background Swapping Contiguous Allocation Paging
Main Memory Session - 16.
Parallel Garbage Collection in Solid State Drives (SSDs)
Lecture 9: Caching and Demand-Paged Virtual Memory
COMP755 Advanced Operating Systems
Virtual Memory.
Virtual Memory 1 1.
Dong Hyun Kang, Changwoo Min, Young Ik Eom
The Design and Implementation of a Log-Structured File System
Presentation transcript:

Trading Flash Translation Layer For Performance and Lifetime 王 江 涛 我们闪存组今天报告的主题是inside and outside ssd 从闪存转换层和性能测试两方面来分析提高ssd性能的方法。 首先由我从设计高效的闪存转换层的角度来讨论提高闪存的读写性能和使用寿命。 接下来高雨同学会从ssd性能测试角度分析闪存的性能。

Outline Introduction Flash Translation Layer Address Mapping 1 Introduction 2 Flash Translation Layer 3 Address Mapping 4 Wear Leveling 5 Conclusion

Introduction of Flash Memory Pros Small size and Lighter weight Low power consumption and Non-Volatility Shock resistance and Lesser noise Faster access performance 近十几年来,闪存已经被广泛应用于各种嵌入式系统和便携式设备;随着闪存容量的快速增长和价格的 不断下降,基于闪存的固态硬盘已经成为一种新的重要的二级存储设备,广泛应用于企业级计算环境中。与磁盘相比有闪存有很多优点 尺寸小、重量轻;能耗少、非易失;抗震动、低噪声,有着更快的读写速度。

flash memory chip OOB ECC(Hamming Code) Logical page number DATA 一个闪存芯片是由多个block组织排列而成,每一个block又有许多page构成; 每一页由两部分区域:数据区域和spare read error correction code:纠错码,通常采用海明码,用于进行一页数据的纠错 OOB ECC(Hamming Code) Logical page number State: erased/valid/invalid

Introduction of Flash Memory Cons Write granularity (page) Erase before write (block) Sequential write within a block Limited erase/write Out-of-place update when a page is to be overwritten, we allocate a new free or erased page we used a software layer called FTL indicate the physical location change of the page 闪存芯片物理组成的特性使得他与磁盘相比又有很多不足的地方。主要有四个方面:写的时候以页为单位; 写前擦除(以block为基本单位);块内顺序写是避免读写干扰;每个block有限的擦除次数 目前成熟的存储管理技术几乎都是基于磁盘的特性进行设计的。比如说更新数据的时候采用原位更新。 闪存 Erase before write的特性使得我们执行原位更新策略的代价太高,采用异地更新的策略; 这些与磁盘不同的策略使得上层应用(文件系统)是不能直接运行在闪存上。解决这个问题的主要方法就是在上层应用与闪存芯片之间加了一个存转换层(FTL).

Outline Introduction Flash Translation Layer Address Mapping 1 Introduction 2 Flash Translation Layer 3 Address Mapping 4 Wear Leveling 5 Conclusion

Flash Translation Layer Function Address mapping Garbage collection(block reclamation) Wear-leveling Address translation:用于完成逻辑地址到物理地址的转换 Garbage collection:回收闪存上有多个无效页。开辟可用空间 Wear leveling 为了使得擦除操作更加均匀,通常采用磨损平衡策略。

Outline Introduction Flash Translation Layer Address Mapping 1 Introduction 2 Flash Translation Layer 3 Address Mapping 4 Wear Leveling 5 Conclusion

Address Mapping Mapping granularity Block-level FTL Scheme Page-level scheme Block-level scheme Hybrid scheme Block-level FTL Scheme The same page offset within logical and physical block Mapping table reside in RAM (size is small) Erase operation frequent and space utilization is low 页级映射采用细粒度映射方式,每一个逻辑页能映射到任何一个物理页;这种模式的灵活性好,效率高。稍后做详细介绍 块级映射:物理块和逻辑块的规格是相同的;通过块内偏移定位块中的某一页 映射粒度比较粗糙,不灵活,擦除操作比较频繁,空间的利用率比较多,不能很好的解决块内顺序写的问题。

Address Mapping Hybrid FTL Scheme DBA: store user data (block-level mapping) LBA: store overwriting data (page-level mapping) 与块级映射不同,混合映射方案把闪存分为两个区域:数据区和日志区,数据区采用块级映射,而日志区采用页级映射 日志区用于数据区页面的数据的异位更新,这种策略提高了空间利用率;实现了日志块内数据的顺序写。但也产生了另一个问题: 因为日志区的数量少,当可用的日志块低于一个阈值时便需要与对应的数据块进行merge操作;以获取新的日志快 其中full Merge操作的代价比较高,这里给出一个full merge 的例子。

Address Mapping Page-level FTL Scheme A logical page number can be mapped into any page Mapping table stored in SRAM[1995] Mapping table is stored in Flash and cached in SRAM[2009] 页级映射: 映射表里存储了物理页和逻辑页的一一对应关系,最早在1995由ban提出,当时用于小容量闪存 页级映射采用细粒度映射方式,比较灵活,映射表比较大,随着闪存容量不断增大,映射表的容量变的很大;ram无法容纳 为了解决RAM大小的问题,一些学者提出将映射表存储在闪存,同时为了提高查找映射信息的速度,将一部分映射信息缓存在RAM。

Page-level FTL Scheme Related work DFTL:A Flash Translation Layer Employing Demand-based Selective Caching of Page-level Address Mapping. (ASPLOS 2009) A Workload-Aware Adaptive Hybrid Flash Translation Layer with an Efficient Caching Strategy (CFTL) (MASCOTS 2011) LazyFTL: A Page-level Flash Translation Layer Optimized for NAND Flash Memory (SIGMOD 2011) 这里页级映射最具代表性的三个工作:一个是DFTL,最先提出将映射表存储在闪存上的页级映射 ; 第二个是 根据访问负载进行自适应调节的混合映射模式;他的主题思想仍然是页级映射 第三个是在sigmod2001发表一篇论文;针对dftl存在的问题提出了以一种lazy的方式解决映射信息更新频繁和可靠性的问题 这里简单介绍一下前两篇工作,然的后重点介绍一下第三篇工作。

DFTL Divided flash memory into MBA and DBA Use page-level mapping MBA--Store the full mapping table on flash DBA—Store user data Use page-level mapping Dynamically swap page-level mapping entries in/out SRAM DFTL:为了提高查询映射信息地速度,选择使用较频繁的映射项缓存在ram,并根据访问负载的变化动态的对缓存信息进行换入换出

DFTL SRAM CMT: Caching Mapping Table GMD: Global Mapping Directory LPN:logical page number PPN: physical page number CMT:Caching Mapping Table improves the mapping table lookup performance GMD: 提供了一个字典,对于一个读写请求我们可以根据请求的逻辑页号,通过查阅GMD来定位映射信息所在的mapping page

DFTL Pros Cons Realize sequential program within a block Avoid full merge Cons Frequently update the mapping pages during garbage collection A poor reliability of mapping information The cost of read is large 优点:解决块内顺序写;避免了full merge;

Workload-Aware Adaptive FTL(CFTL) Divided flash memory into MBA and DBA MBA--Store the full mapping on flash DBA—Store user data Use page-level mapping and block-level mapping Dynamically swap page-level mapping entries in/out SRAM Convert to each other based on data access patterns Read intensive: Block-level mapping Write intensive: Page-level mapping 针对DFTL读代价较高的特点,CFTL采用了动态的映射模式, 因为块级映射有利于读操作,当读操作密集时;就采用块级映射模式;如果写操作密集就采用页级映射;

Workload-Aware Adaptive FTL(CFTL) Pros Realize sequential program within a block Avoid full merge Exploit temporal and spatial locality and workloads Improve the performance of read Cons Frequently update the mapping pages during garbage collection A poor reliability of mapping information Expensive read/write cost to build block mapping table 块级映射表要求逻辑上相邻的逻辑号在物理上也应该相邻 当在进行垃圾回收建立块级映射表的时; 有时需要把分散在不同物理块的数据集中到一起去代价很大

LazyFTL DBA: store user data MBA: store mapping pages(page-level scheme) CBA: store valid user data when implement garbage collection UBA: Implement write requests 针对DFTL和CFTL 存在的映射信息可靠性和更新频繁的问题;lazyftl提出了一种新的解决方案 把闪存区域划分为四个区域:DBA MBA UBA CBA; 四个区域通过三个基本操作相互关联。 其中UBA和CBA所占比例比较小,当可用空间低于给定的阈值时会执行convert操作 以一种lazy的方式完成延时和批量更新

LazyFTL Write Garbage Collection Convert Complete a write request in the UBA Store new mapping formation in RAM ( UMT: update mapping table ) Garbage Collection Reclaim a victim block in the DBA or the MBA Move valid data pages to CBA and store new mapping formation in RAM (UMT) Convert Implement a batch updates Convert CBA/UBA to DBA 写操作是在UBA区域完成的;把产生的新的映射信息存储RAM里(UMT) 垃圾回收是在DBA或者MBA区域内完成的,对DBA数据回收时将有效的数据页存储到CBA区域,把产生的新的映射信息存储在RAM里 如果CBA/UBA可用的数据块低于设置的阈值便选择一个block执行convert操作,根据UMT批量更新映射信息;并将block 转换为DBA

LazyFTL UMT的作用对映射信息进行延迟批量的更新,提高写的性能减少擦除次数。 因为采用了延迟更新,我们必须对新增到UMT的映射信息的状态进行一个跟踪,在每一个UMT中的映射项都添加了两个标志位 Update=1:表示该映射项信息需要添加或更新到mapping page Invalidate=1:表示映射项中逻辑页号关联的数据页要标记为无效,也就是说该逻辑页在DBA去存在一个旧版本的数据; 这些操作有convert来完成,下面开一个例子

Convert Algorithm 算法采用批量更新策略。执行convert操作时根据要擦除快的映射信息找到这些映射信息所关联的映射页集合 极为P, 然后查找UMT中其他与P相关的其它映射项,把这两部分映射信息进行一次批量更新,减少了擦除操作。

Performance Evaluation 作者将lazyftl与已有的一些映射策略和一种理想化的模式做了一个对比 这里理想化模式是指每一次读操作请求只引发一次读操作;每一次写操作请求只引发一次写操作;写满一页才引发一次擦除操作。 从实验结果来看lazyftl确实减少了擦除操作,提高了写的性能

LazyFTL Pros Adopt an update buffer to decrease frequently update the mapping pages Achieve consistency and reliability Improve write performance by reduce erase operation Cons Increase the cost of read operation Decrease speedup of garbage collection Not considering hot-cold data for wear leveling 作者采用了一种lazy的方式来对映射信息进行批量和延迟更新,减少了擦除操作 另外提高了可靠性(因为当系统发生故障时只需要扫描小部分区域即可重建映射信息) 因为采用延迟更新的策略,在执行垃圾回收时有对数据页的有效性进行判断,同时对甄别冷然数据带来了难度,不利于磨损平衡策略的实施

Outline Introduction Flash Translation Layer Address Mapping 1 Introduction 2 Flash Translation Layer 3 Address Mapping 4 Wear Leveling 5 Conclusion

Wear Leveling Introduction Some definitions Basic principle Any one part of flash memory can only withstand a limited number of erase-write cycles Localities of data access inevitably degrade wear evenness in flash Some definitions Hot data block and cold data block (access frequency) Old block and young block (erase counts) Basic principle Prevent old blocks from being erased(cool down) Start erasing young blocks actively(heat up) 首先介绍一下磨损平衡的基本情况。前面讲的页级映射模式主要是减少擦除操作,提高闪存的读写性能。但是闪存还有另外一个特点就是有限的擦除次数 访问负载的区域性特点使得闪存中block之间的擦除次数是不均衡的,这对闪存的寿命有很大影响 Wear Leveling 的基本思想就是尽可能均匀的擦除block;

Wear Leveling Cold data migration Related work(Hybrid FTL Scheme) move cold data from young blocks to old blocks Select young blocks when execute garbage collection Related work(Hybrid FTL Scheme) A Low-Cost Wear-Leveling Algorithm for Block-Mapping Solid-State Disks (lazy scheme) (LCTES2011) Cold data migration :将冷数据迁移到old block 中 因为冷数据不会频繁的更新,存放冷数据的block被擦除的该概率比较低。

Lazy Scheme Overview Recency Frequency Cold data migration Consider recency (recent wear history ) and frequency Recency Update recency ( a logical block ) the time length since the latest update to a logical block Erase recency ( a physical block ) the time length since the latest erase operation on a physical block Frequency Elder block larger than the average erase count Junior block smaller than the average erase count lazy 模式将擦除块的最近擦除情况和当前的擦除状态进行了一个有效地结合, 原因是根据时间局部性的特点最近被更新的逻辑块有可能会很很快被再次更新,而它对应的物理块也就很可能再次被擦除。 根据这两个因素来选择擦除平衡选择的对象,会使擦除更加均衡

Lazy Scheme The goal of wear-leveling is that a block should keep its erase count close to the average. 下面通过一幅图来阐述作者的主要想法:为了降低磨损平衡的工作负载我们只对部分数据块感兴趣。首先找出最近擦除程度低的年轻块(也就是存放冷数据的数据块); 把数据迁移到最近擦除程度高的年老的块(含有热数据)。让这些年轻块参入到垃圾回收中,增加他们被擦除次数,从而达到磨损平衡 For junior block, we are interested in Block e and f. For elder block, we are interested in block a and b. We need to move valid data in block e and f to block a and b Re-map e and f to a and b and select Block e and f as victim blocks

Algorithm

Lazy Scheme Pros does not store wear information in RAM, but leaves all of this information in flash instead. utilizes the address-mapping information available and do not need to add extra data structures for wear leveling Cons It is important to uniformly visit every logical block when selecting a logical block for re-mapping.

Outline Introduction Flash Translation Layer Address Mapping 1 Introduction 2 Flash Translation Layer 3 Address Mapping 4 Wear Leveling 5 Conclusion

Conclusion Conclusion Page mapping scheme shows the best performance in that it can decrease erase operations It is necessary to design an efficient wear leveling scheme for Page-Mapping Solid-State disks Some operations in FTL can be executed without interrupting current flash accesses by exploiting internal parallelism of flash memory As write caching to reduce erase operation SSD for primary storage, auxiliary PCM 页级映射模式大大减少了擦除操作,提高了ssd的性能 目前磨损平衡策略都是针对块级或混合级映射而设计的。设计基于页级映射是磨损平衡策略是非常必要的 可以利用ssd内部的并行机制,通过巧妙地设计使得ftl的几种操作与上层数据访问并行执行,提高整体性能 减少擦除操作也可以从硬件着手,将磁盘、SSD、pcm等组合在一起;构成混合存储系统; 比如 可以让磁盘或PCM作为ssd的写缓冲用于处理写操作和更新,减少擦除操作,ssd则主要用于处理读操作等。

Thank you