A Design of Flash Memory File System for Embedded Systems

783 views
686 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
783
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A Design of Flash Memory File System for Embedded Systems

  1. 1. A Design of Flash Memory File System for Embedded Systems Systems and Computers in Japan, Vol.35, No. 1, 2004 Noritaka Ishizumi (IBM Japan), Keizo Saisho (Kagawa University), Akira Fukuda Speaker : Kim, Jung Kuk OS Lab, SNU
  2. 2. Table of Contents <ul><li>Introduction </li></ul><ul><li>Related Work </li></ul><ul><li>Flash Memory </li></ul><ul><li>Design Policy of File System </li></ul><ul><li>Design of File System </li></ul><ul><li>Evaluation </li></ul><ul><li>Conclusion </li></ul>
  3. 3. Introduction <ul><li>File Entry Area </li></ul><ul><ul><li>Contains file information </li></ul></ul><ul><ul><li>Frequently created, updated, deleted </li></ul></ul><ul><li>To reduce turnaround time of memory ops </li></ul><ul><ul><li>Reducing the amount of data written </li></ul></ul><ul><ul><li>Reducing the number of block erase ops </li></ul></ul><ul><ul><ul><li>By writing only the difference (appending ops) </li></ul></ul></ul><ul><li>To improve durability of flash memory </li></ul><ul><ul><li>Balancing the number of block erase ops </li></ul></ul><ul><ul><li>for each erase block (wear-leveling) </li></ul></ul><ul><ul><ul><li>by using erase counter & linked lists management </li></ul></ul></ul><ul><ul><ul><li>little degradation in efficiency </li></ul></ul></ul>
  4. 4. Related Work <ul><li>LFS File Manager (LFM) </li></ul><ul><li>Flash Data Integrator (FDI) </li></ul><ul><li>Data Management System (DMS) </li></ul><ul><li>Flash Translation Layer (FTL) </li></ul><ul><li>Microsoft Flash File System (MS-FFS) </li></ul>
  5. 5. Flash Memory <ul><li>Flash EEPROM </li></ul><ul><li>Characteristic of ops (cell state change) </li></ul><ul><li>Suspended write & block erase ops </li></ul><ul><ul><li>Read ops ahead </li></ul></ul><ul><ul><li>delay </li></ul></ul>
  6. 6. Design Policy of File System <ul><li>Target Device </li></ul><ul><ul><li>Digital Hand-held devices (Dica, Voice Recorder, MP3 player) </li></ul></ul><ul><ul><ul><li>file size : more than tens of KiBs </li></ul></ul></ul><ul><ul><ul><li># of files : several hundred </li></ul></ul></ul><ul><ul><ul><li>No update w/ a small unit of data </li></ul></ul></ul><ul><ul><ul><li>Appending operations are mainly done in update </li></ul></ul></ul><ul><li>Logical structure and interface </li></ul><ul><ul><li>Flat directory is adopted </li></ul></ul><ul><ul><ul><li>To reduce the overhead of file ops </li></ul></ul></ul><ul><ul><li>Common Flash Interface (CFI) </li></ul></ul><ul><li>Requirements for flash memory file system </li></ul><ul><ul><li>Distribution & reduction of rewrite </li></ul></ul><ul><ul><ul><li>File entries at any locations by managing linked lists (block erase scattered) </li></ul></ul></ul><ul><ul><li>Real-time read ops (within a fixed interval) </li></ul></ul><ul><ul><ul><li>Suspend function </li></ul></ul></ul><ul><ul><ul><li>FDI performs block erase ops in the background </li></ul></ul></ul>
  7. 7. Design of File System <ul><li>Overview of file system </li></ul><ul><ul><li>Link structured file system </li></ul></ul><ul><ul><ul><li>To restrict the # of memory write </li></ul></ul></ul><ul><ul><ul><li>to only one </li></ul></ul></ul><ul><ul><ul><li>File ops performed by appending ops . </li></ul></ul></ul><ul><ul><li>Allocation of an erase block </li></ul></ul><ul><ul><li>2 problems </li></ul></ul><ul><ul><ul><li>Fragmentation in free space </li></ul></ul></ul><ul><ul><ul><ul><li> Garbage collection </li></ul></ul></ul></ul><ul><ul><ul><li>Link pointer cannot be changed once it has been written </li></ul></ul></ul><ul><ul><ul><ul><li>introduces ‘reserved link pointer’ & ‘delete bit’ in file entry </li></ul></ul></ul></ul>File block
  8. 8. Design of File System <ul><li>Structure of file entry </li></ul><ul><ul><li>Basic file entry </li></ul></ul><ul><ul><ul><li>Invalid file entry </li></ul></ul></ul><ul><ul><ul><li>File name related flags </li></ul></ul></ul><ul><ul><ul><li>Data area related flags </li></ul></ul></ul><ul><ul><ul><li>Update time related flags </li></ul></ul></ul><ul><ul><ul><li>File link pointer related flags </li></ul></ul></ul><ul><ul><ul><li>Append link pointer related flags </li></ul></ul></ul>
  9. 9. Design of File System <ul><li>Data appending w/o block erase </li></ul><ul><ul><li>Read the file entry of the target file from flash memory </li></ul></ul><ul><ul><li>Retrieve the last file block of the file to be read by tracing linked lists </li></ul></ul><ul><ul><li>Create a file block consisting of data area and file entry including append link pointers, data size, update time and related flags in the write buffer </li></ul></ul><ul><ul><li>Write the appended data into the data area, as well as the size of appended data and the current time into the file entry on the write buffer </li></ul></ul><ul><ul><li>Write the contents of the write buffer into flash memory </li></ul></ul><ul><ul><li>Write the pointer of the file block written at (5) into the append link pointer of the file block retrieved at (2) </li></ul></ul>
  10. 10. Design of File System <ul><li>Garbage Collection </li></ul><ul><ul><li>When a file is deleted, </li></ul></ul><ul><ul><ul><li>not actually deleted, but only flag bit is invalidated </li></ul></ul></ul><ul><ul><li>Link modification entry </li></ul></ul><ul><ul><ul><li>LM extends alternate link pointer of FB1, </li></ul></ul></ul><ul><ul><ul><ul><li>So it should be in the same erase </li></ul></ul></ul></ul><ul><ul><ul><li>block as FB1 </li></ul></ul></ul><ul><ul><ul><li>GC trigger condition </li></ul></ul></ul><ul><ul><ul><ul><li># of deletion increases </li></ul></ul></ul></ul><ul><ul><ul><ul><li>free space for LM becomes scarce </li></ul></ul></ul></ul><ul><ul><li>Intensive allocation of file blocks </li></ul></ul><ul><ul><ul><li>when creation of a new file or appending, </li></ul></ul></ul><ul><ul><ul><ul><li>allocate unused erase blocks as far as possible </li></ul></ul></ul></ul><ul><ul><li>Use of suspend function </li></ul></ul><ul><ul><ul><li>GC is time-consuming, so suspend op can be performed </li></ul></ul></ul><ul><ul><ul><li>to diminish the delay of read op. </li></ul></ul></ul>
  11. 11. Evaluation <ul><li>Simulator and experimental environment </li></ul><ul><ul><li>Flash memory simulator </li></ul></ul><ul><ul><ul><li>read, write, block erase I/F that take out log info. such as # of bytes. </li></ul></ul></ul><ul><ul><li>Flash memory file system (proposed here) </li></ul></ul><ul><ul><ul><li>open, read, write, unlink, rename, lseek </li></ul></ul></ul><ul><ul><ul><li>erase block selection </li></ul></ul></ul><ul><ul><ul><ul><li>min. value of “current effective used area + </li></ul></ul></ul></ul><ul><ul><ul><ul><li># of block erase ops. X 2KB” </li></ul></ul></ul></ul><ul><ul><ul><ul><li>to distribute block erase during GC </li></ul></ul></ul></ul><ul><ul><li>Test System </li></ul></ul><ul><ul><ul><li>Windows 2000, AMD K7 550 MHz, Visual C++ 5.0 (/Omax) </li></ul></ul></ul>
  12. 12. Evaluation <ul><li>Reduction and distribution of block erase ops . </li></ul><ul><ul><li>Reduction </li></ul></ul><ul><ul><ul><li>creation & deletion of files, (10,000 logs) </li></ul></ul></ul><ul><ul><ul><ul><li>64KB & 50KB average size </li></ul></ul></ul></ul><ul><ul><ul><ul><li>16MB flash memory (64KB blk size) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>create 255 files (DOS-FAT), </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>randomly erase 10%(26) files </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>create 10%(26) files, repeat 2 steps </li></ul></ul></ul></ul></ul><ul><ul><ul><li>result </li></ul></ul></ul><ul><ul><ul><ul><li>9249 : 36.1 (Link structured FFS) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>30,000 : 117.2 (DOS-FAT FS) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>3 times better </li></ul></ul></ul></ul><ul><ul><li>Distribution </li></ul></ul><ul><ul><ul><li>mean erase count per block : 33 </li></ul></ul></ul><ul><ul><ul><li>difference b/w min and max : 22 </li></ul></ul></ul>
  13. 13. Evaluation <ul><li>Distribution of file creation time </li></ul><ul><ul><li>Result </li></ul></ul><ul><ul><ul><li>assumption </li></ul></ul></ul><ul><ul><ul><ul><li>1 byte write (8us), 1 block erase (1s) </li></ul></ul></ul></ul><ul><ul><ul><li>Table.1 </li></ul></ul></ul><ul><ul><ul><ul><li>260 files creation time </li></ul></ul></ul></ul><ul><ul><li>Drawback </li></ul></ul><ul><ul><ul><li>2 block erases </li></ul></ul></ul><ul><ul><ul><ul><li>should be avoided in real-time applications </li></ul></ul></ul></ul><ul><ul><ul><li>background GC or timing to initiate GC is important </li></ul></ul></ul><ul><ul><ul><ul><li>eg. initiate GC at threshold # of ops </li></ul></ul></ul></ul>
  14. 14. Evaluation <ul><li>Comparison of amount of write </li></ul><ul><ul><li>the amount of write, </li></ul></ul><ul><ul><ul><li>when 100KB file created by appending a fixed amount </li></ul></ul></ul><ul><ul><li>without append (write into new block) </li></ul></ul><ul><ul><ul><li>Internal fragmentation increases, </li></ul></ul></ul><ul><ul><ul><li>as the amount per appending decreases. </li></ul></ul></ul><ul><ul><ul><li>twice around 40KB </li></ul></ul></ul><ul><ul><ul><li>rapidly increase around 10KB </li></ul></ul></ul><ul><ul><li>with append (append into a block w/ free space) </li></ul></ul><ul><ul><ul><li>rapidly increase around 200 bytes </li></ul></ul></ul><ul><ul><ul><ul><li>as the ratio of management info. VS. appending data </li></ul></ul></ul></ul><ul><ul><ul><ul><li>becomes large </li></ul></ul></ul></ul><ul><ul><li>such a small unit rarely happens in embedded systems </li></ul></ul>
  15. 15. Conclusion <ul><li>Link structured FFS </li></ul><ul><ul><li>extends the life of flash memory </li></ul></ul><ul><ul><ul><li>through averaging the block erase count </li></ul></ul></ul><ul><ul><ul><ul><li>by managing files with linked list </li></ul></ul></ul></ul><ul><ul><ul><ul><li>by providing each block with erase counter </li></ul></ul></ul></ul><ul><ul><li>increases freedom of appending </li></ul></ul><ul><ul><ul><li>by appending the difference in update </li></ul></ul></ul><ul><ul><ul><li>and appending link modification </li></ul></ul></ul><ul><ul><li>shortened the file writing time </li></ul></ul>

×