Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Predictable FTL for Buffer Reordering Hanhong Keum Real-Time Operating Systems Laboratory,  Seoul National University, Kor...
Outlines <ul><li>Background </li></ul><ul><ul><li>NAND Flash Memory </li></ul></ul><ul><ul><li>Petri Net </li></ul></ul><u...
The Characteristics (1) <ul><li>Architecture </li></ul><ul><ul><li>Block & Page </li></ul></ul><ul><ul><ul><li>Number of p...
The Characteristics (2) <ul><li>Technical challenges </li></ul><ul><ul><li>Erase-before-write </li></ul></ul><ul><ul><li>D...
FTL (Flash Translation Layer) <ul><li>A device driver of NAND Flash Memory </li></ul><ul><li>FTL makes NAND Flash Memory a...
Log Block Scheme <ul><li>FTL uses the log block scheme </li></ul><ul><li>Background: NAND Flash Memory </li></ul>data data...
Garbage Collection <ul><li>Garbage collection reclaims invalid pages to free pages </li></ul><ul><li>Background: NAND Flas...
Terminology <ul><li>Transaction (also called Job) ≡ A unit of interaction with FTL </li></ul><ul><ul><li>Two kinds of tran...
<ul><li>Petri Net is a directed bipartite graph </li></ul><ul><ul><li>Consist of places, transitions, directed arcs </li><...
<ul><li>Program memory is always restricted to use in portable and embedded systems </li></ul><ul><ul><li>Buffer, one of t...
Solution <ul><li>When a write transaction is occurred, </li></ul><ul><ul><li>The kernel informs FTL that it has a buffer b...
The Requirements for SJF <ul><li>Average response time of each transaction   *Assumption(not in the paper)  Since variatio...
How to get the requirements (1) <ul><li>Average response time of each transaction </li></ul><ul><ul><li>Finding a set of o...
FTL Modeling (1) <ul><li>Operations in FTL can be divided into four categories </li></ul><ul><ul><li>I/O processing </li><...
FTL Modeling (2) <ul><li>Writing a single page ( writePage ) </li></ul><ul><ul><li>Write data(a page) to  the available lo...
FTL Modeling (3) <ul><li>Make an active log group ( makeActive ) </li></ul><ul><ul><li>Unprotect a log group for write </l...
FTL Modeling (4) <ul><li>Wear-leveling ( WLFBlk ) </li></ul><ul><li>Erasing a block  ( eraseFBlk ) </li></ul><ul><li>Garba...
Petri Net Model of FTL
Operation Scheduling Algorithm <ul><li>Algorithm </li></ul><ul><ul><li>Propagate the token demanded on  p 1  until finding...
How to get the requirements (2) <ul><li>Preemption </li></ul><ul><ul><li>It is required to predict the remaining execution...
Etc. - Minimizing the Number of WCET Recalculation <ul><li>WCET of each transaction is calculated based on the available r...
System Model FTL Transaction info. WCET of transaction data Buffer Memory … SJF scheduling Buffer reordering Buffer Manage...
Experiment <ul><li>Average bitrate vs. buffer memory usage </li></ul><ul><ul><li>Over 60% reduction when more than 1MB was...
Thank You!!!
Upcoming SlideShare
Loading in …5
×

Predictable FTL for Buffer Reordering.ppt

1,017 views

Published on

  • Be the first to comment

Predictable FTL for Buffer Reordering.ppt

  1. 1. Predictable FTL for Buffer Reordering Hanhong Keum Real-Time Operating Systems Laboratory, Seoul National University, Korea 2009-02-16 disserted by Jaesoo, Lee
  2. 2. Outlines <ul><li>Background </li></ul><ul><ul><li>NAND Flash Memory </li></ul></ul><ul><ul><li>Petri Net </li></ul></ul><ul><li>Motivation </li></ul><ul><li>Solution </li></ul><ul><ul><li>FTL Modeling </li></ul></ul><ul><ul><li>Operation Scheduling Algorithm </li></ul></ul><ul><li>System Model </li></ul><ul><li>Experiment </li></ul>
  3. 3. The Characteristics (1) <ul><li>Architecture </li></ul><ul><ul><li>Block & Page </li></ul></ul><ul><ul><ul><li>Number of pages in a block </li></ul></ul></ul><ul><ul><ul><li>Data area + Spare area in a page </li></ul></ul></ul><ul><ul><li>Basic operations </li></ul></ul><ul><ul><ul><li>Read, Write: page unit of operation </li></ul></ul></ul><ul><ul><ul><li>Erase: block unit of operation </li></ul></ul></ul><ul><li>Background: NAND Flash Memory </li></ul>Spare Page … Spare Page Spare Page Spare Page Spare Page … Spare Page Spare Page Spare Page Spare Page … Spare Page Spare Page Spare Page … Block #0 Block #1 Block #(n-1)
  4. 4. The Characteristics (2) <ul><li>Technical challenges </li></ul><ul><ul><li>Erase-before-write </li></ul></ul><ul><ul><li>Different access time </li></ul></ul><ul><ul><ul><li>Erase(x10) > Write(x10) > Read </li></ul></ul></ul><ul><ul><li>The limitation of numbers of erase/write operations (≈ ) </li></ul></ul><ul><li>Background: NAND Flash Memory </li></ul>
  5. 5. FTL (Flash Translation Layer) <ul><li>A device driver of NAND Flash Memory </li></ul><ul><li>FTL makes NAND Flash Memory act like a block device by hiding the limitations </li></ul><ul><li>Functions </li></ul><ul><ul><li>Bad block management </li></ul></ul><ul><ul><li>Error correction code (ECC) </li></ul></ul><ul><ul><li>Logical- to-physical addressing </li></ul></ul><ul><ul><li>Garbage collection </li></ul></ul><ul><ul><li>Power-off recovery </li></ul></ul><ul><ul><li>Wear-leveling </li></ul></ul><ul><li>Background: NAND Flash Memory </li></ul>File systems Applications FTL NAND Flash controller NAND Flash System
  6. 6. Log Block Scheme <ul><li>FTL uses the log block scheme </li></ul><ul><li>Background: NAND Flash Memory </li></ul>data data data data L0 L1 L2 L3 Logical Address data invalid invalid data P0 P1 P2 P3 data data data data P4 P5 P6 P7 data data (free) (free) P8 P9 P10 P11 No.0 Physical Block Physical Address No.1 Physical Block No.2 Physical Block No.0 Logical Block
  7. 7. Garbage Collection <ul><li>Garbage collection reclaims invalid pages to free pages </li></ul><ul><li>Background: NAND Flash Memory </li></ul>data invalid invalid data Free Free Free Free data data Data Block Free Block Log Block invalid invalid
  8. 8. Terminology <ul><li>Transaction (also called Job) ≡ A unit of interaction with FTL </li></ul><ul><ul><li>Two kinds of transaction: read, write </li></ul></ul><ul><li>Operation ≡ A unit of work that is scheduled and executed by FTL </li></ul><ul><ul><li>A transaction consists of a set of operations </li></ul></ul><ul><ul><li>e.g. erase a block, do garbage collection, etc. </li></ul></ul><ul><li>Resource ≡ Any physical or virtual entity of limited availability within a system </li></ul><ul><li>Background: NAND Flash Memory </li></ul>
  9. 9. <ul><li>Petri Net is a directed bipartite graph </li></ul><ul><ul><li>Consist of places, transitions, directed arcs </li></ul></ul><ul><ul><li>Arcs run between places and transitions </li></ul></ul><ul><ul><li>Places may contain any non-negative number of tokens </li></ul></ul><ul><ul><li>A distribution of tokens over the places is called a marking </li></ul></ul><ul><ul><li>A transition may fire whenever there is a token at the end of all input arcs </li></ul></ul>Petri Net <ul><li>Background: Petri Net </li></ul>2 p 1 p 2 p 3 t 1 2 p 1 p 2 p 3 t 1 after fire place transition token arc (and weight) k
  10. 10. <ul><li>Program memory is always restricted to use in portable and embedded systems </li></ul><ul><ul><li>Buffer, one of the program memory, is used to access to storage device such as disk </li></ul></ul><ul><li>Recently, NAND Flash Memory is widely used to save huge data and when accessing to NAND Flash Memory, buffer memory is used </li></ul><ul><li>How about reducing buffer usage by analyzing the characteristics of NAND Flash Memory? </li></ul>Motivation
  11. 11. Solution <ul><li>When a write transaction is occurred, </li></ul><ul><ul><li>The kernel informs FTL that it has a buffer block whose contents should be output, and FTL schedules the block for I/O </li></ul></ul><ul><li>SJF (Shortest-Job-First) </li></ul><ul><ul><li>*Note) SJF is optimal to minimize average response time </li></ul></ul><ul><ul><li>A transaction that has the shortest average response time is scheduled first </li></ul></ul><ul><ul><li>≡ Minimize average time to occupy buffer by a transaction </li></ul></ul><ul><ul><li>≡ Reduce the maximum buffer usage </li></ul></ul>
  12. 12. The Requirements for SJF <ul><li>Average response time of each transaction *Assumption(not in the paper) Since variation of average response time of the same operation is small, average response time can be got from WCET of the operations </li></ul><ul><li>Preemption </li></ul><ul><ul><li>Preemption is allowed when the average response time of a transaction is shorter than the currently executed one </li></ul></ul>
  13. 13. How to get the requirements (1) <ul><li>Average response time of each transaction </li></ul><ul><ul><li>Finding a set of operations that are going to be executed in a transaction </li></ul></ul><ul><ul><li>Calculation of average response time of each transaction </li></ul></ul><ul><ul><ul><li>Simple summation of WCET of each operation in a set </li></ul></ul></ul><ul><ul><ul><li>*Note) WCET of all of the operations is calculated by static analysis or measurement analysis at offline </li></ul></ul></ul>A set of operations <ul><li>Petri Net Modeling </li></ul><ul><li>Resources </li></ul><ul><li>Operations </li></ul>Offline Online Operation Scheduling Algorithm FTL Model available resources The data structure of FTL WCET of each operation
  14. 14. FTL Modeling (1) <ul><li>Operations in FTL can be divided into four categories </li></ul><ul><ul><li>I/O processing </li></ul></ul><ul><ul><ul><li>a page write </li></ul></ul></ul><ul><ul><li>Changing state of a log group </li></ul></ul><ul><ul><ul><li>active or inactive state </li></ul></ul></ul><ul><ul><ul><li>new log block allocation </li></ul></ul></ul><ul><ul><li>Garbage collection </li></ul></ul><ul><ul><ul><li>garbage collection for meta blocks or log blocks </li></ul></ul></ul><ul><ul><li>Changing state of physical block </li></ul></ul><ul><ul><ul><li>erasing a block </li></ul></ul></ul><ul><ul><ul><li>wear-leveling for a free block </li></ul></ul></ul>
  15. 15. FTL Modeling (2) <ul><li>Writing a single page ( writePage ) </li></ul><ul><ul><li>Write data(a page) to the available log page </li></ul></ul><ul><ul><li>The target log group is required to be in an active state </li></ul></ul><ul><ul><li>Consumes a free log page resource </li></ul></ul><ul><li>Allocating new log block ( getNewLog ) </li></ul><ul><ul><li>Allocate a free block for a new log block </li></ul></ul><ul><ul><li>Log page resources are newly created </li></ul></ul>
  16. 16. FTL Modeling (3) <ul><li>Make an active log group ( makeActive ) </li></ul><ul><ul><li>Unprotect a log group for write </li></ul></ul><ul><ul><li>The state of the log group is changed from inactive to active </li></ul></ul><ul><li>Making a room for active log group ( makeInactive ) </li></ul><ul><ul><li>Produce an active log group slot resource </li></ul></ul><ul><ul><li>By changing the state of a victim active log group to inactive </li></ul></ul>
  17. 17. FTL Modeling (4) <ul><li>Wear-leveling ( WLFBlk ) </li></ul><ul><li>Erasing a block ( eraseFBlk ) </li></ul><ul><li>Garbage collection ( SelfCompaction ) </li></ul>
  18. 18. Petri Net Model of FTL
  19. 19. Operation Scheduling Algorithm <ul><li>Algorithm </li></ul><ul><ul><li>Propagate the token demanded on p 1 until finding an enabled transition using DFS(Depth-First-Search) way </li></ul></ul><ul><ul><li>Fire it, and repeat until there is no more demand </li></ul></ul><ul><ul><li>The series of fired transitions are the solution </li></ul></ul><ul><li>Time complexity is O(n) -> low overhead </li></ul><ul><li>For example, </li></ul>step p 1 p 2 p 3 p 4 p 5 p 6 p 7 p 8 transition (1) 0 0 0 1 1 1 1 0 t 2 (2) 0 1 0 1 0 1 1 0 t 3 (3) 0 1 1 1 0 0 0 0 t 1 result 1 0 0 0 0 0 0 0
  20. 20. How to get the requirements (2) <ul><li>Preemption </li></ul><ul><ul><li>It is required to predict the remaining execution time of the currently executed transaction at run-time to compare with a newly arrived transaction </li></ul></ul><ul><ul><ul><li>The remaining execution time of the currently executed operation + the WCET of the remaining operations </li></ul></ul></ul><ul><ul><li>Should recalculate the operation set when the preempted transaction is resumed, since available resources may be changed </li></ul></ul><ul><ul><ul><li>But, mostly same before preemption </li></ul></ul></ul>
  21. 21. Etc. - Minimizing the Number of WCET Recalculation <ul><li>WCET of each transaction is calculated based on the available resource at that time when a transaction is occurred </li></ul><ul><ul><li>WCET recalculation of transactions is required after finishing execution of other transaction, since the available resource may be changed </li></ul></ul><ul><li>But, recalculation is needed only when the resource conflict </li></ul><ul><li>To minimize the number of WCET recalculation </li></ul><ul><ul><li>Using the resource domain </li></ul></ul>
  22. 22. System Model FTL Transaction info. WCET of transaction data Buffer Memory … SJF scheduling Buffer reordering Buffer Manager Operation Scheduling Algorithm Operation Schedule
  23. 23. Experiment <ul><li>Average bitrate vs. buffer memory usage </li></ul><ul><ul><li>Over 60% reduction when more than 1MB was used </li></ul></ul>
  24. 24. Thank You!!!

×