16
Real-Time Support of Flash Memory File System for Embedded Application Sudeep Jain and Yang-Hang Lee(Arizona State University) Sudeep Jain and Yang-Hang Lee(Arizona State University) IEEE Workshop on Software Technology for Future Embedded and IEEE Workshop on Software Technology for Future Embedded and Ubiquitous System and Ubiquitous System and International Workshop on Collaborate Computing,Integration, and International Workshop on Collaborate Computing,Integration, and Assurance (SEUS-WCCIA ’06) Assurance (SEUS-WCCIA ’06)

Real-Time Support of Flash Memory File System for Embedded

Embed Size (px)

Citation preview

Page 1: Real-Time Support of Flash Memory File System for Embedded

Real-Time Support of Flash Memory File System for Embedded Application

Sudeep Jain and Yang-Hang Lee(Arizona State University)Sudeep Jain and Yang-Hang Lee(Arizona State University)

IEEE Workshop on Software Technology for Future Embedded and IEEE Workshop on Software Technology for Future Embedded and Ubiquitous System and Ubiquitous System and International Workshop on Collaborate Computing,Integration, and International Workshop on Collaborate Computing,Integration, and Assurance (SEUS-WCCIA ’06)Assurance (SEUS-WCCIA ’06)

Page 2: Real-Time Support of Flash Memory File System for Embedded

Introduction

• NAND Flash feature– Bank : simultaneous operation unit– Block : basic unit for erase – Page : basic unit for write/read

• Pros for Real-Time– Size and robustness– Constant time response for each access

• Cons – Garbage collection ( not constant time response)– Out-place update ( log structure file system )– Large RAM footprint (direct map )

Page 3: Real-Time Support of Flash Memory File System for Embedded

Background

• Naïve garbage collection – cause a long blocking delay– Erase-operation : non-preemptible section

• Real Time GC– not a lot of work on Real Time Flash– Chiang : real time periodic GC

• Rely on OS• Real time access is provided by real-time task

declaring resource requirement (period, write #)

Page 4: Real-Time Support of Flash Memory File System for Embedded

Background

• High RAM footprint– Logical to physical address mapping– YAFF,JFFS

• Treat block as logical log• Make update to data as update to a log of change• Suffer from very high RAM foot print• Due to direct map (logical -> physical )

Page 5: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access

• Requirement– Read access should be real time– Not delayed by write, erase

• 2 bank is 1 set– Any bank in set : read or write status– Read state is reserved for real time read

Page 6: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access

• Real Time Read– If request data exists in write buffer, read data– Otherwise, select bank– Send read request

Page 7: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access - Real Time Write

• Aim : Making 2 copies in two bank• Bank W ( bank in ‘write’ status)

Bank R ( bank in ‘read’ status)• process

– Select a bank and change status of the bank to ‘write’– Stage 1

• Write data in bank W • Also can GC in Bank W• Queue data in bank R

– Stage 2• Change status in bank R ( “read” -> “write” )• Write delayed data in bank R

Page 8: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access - Real Time Write

Bank RBank W

Write Request

GC Read

Write Queue Write Queue

Page 9: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access - etc

• Non Real Time Access– Only a single copy – Queued in non-real-time request

• Garbage Collection– After every write operation – Check number of dead page

• Nth: number of dirty page set to threshold.

– If need GC, start GC– Copy live page as non real time write

Page 10: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access - analysis

• Real-time Write Bandwidth– TGC =2(Nrecliamtwrite+tGC)

– tGC=(Np-Nreclaim)(tread+twrite)+terase

– If we can have at most Nreclaim logical write

Page 11: Real-Time Support of Flash Memory File System for Embedded

Real Time Media Access - analysis

– Nreclaim

• Worst case when all dirty page is uniformly distributed on bank

• Nreclaim >= Ndirty / # of blocks on a bank

• Real-time Read Bandwidth– One memory bank is dedicated toward read

request

Page 12: Real-Time Support of Flash Memory File System for Embedded

Reducing Memory Footprint

• To reduce memory footprint, we can use– Data structure stored in media– Data structure stored in RAM

• Easiest way – Move per inode DS to flash– Hierarchical storage scheme

• Top tier stored in RAM• Lower layer loaded into RAM when required

Page 13: Real-Time Support of Flash Memory File System for Embedded

Data Structure in Media

• Page table fragment– Data stored in Out of Band (OOB) area in flash– A list of physical page addresses that belong to

inode• If page size is 512 byte• Page table entry 4 byte -> 128 pointer• Maximum file size = 216*128*512byte=4GB

Page 14: Real-Time Support of Flash Memory File System for Embedded

OOB area of Page Table Fragment

Update to page table fragment is delayed for efficiency

If two copies of the pages

is valid

Page 15: Real-Time Support of Flash Memory File System for Embedded

Data Structure in RAM

• A list of Page that store the page table for Inode– Required space is growth of # of files.– Each page fragment store up to 128 PTE– Substantial saving over traditional LFS

• Page table fragment cache– Read : read page fragment -> read data– Write : update physical page -> update page fragment– Cache is useful for both read and write.

Page 16: Real-Time Support of Flash Memory File System for Embedded

Conclusion

• We solve– Long blocking delay of garbage collection– Large RAM footprint of log structured flash file

system.