ayse ozturk sunum (0,2 mb)

24
The Design Of Efficient Initialization And Crash Recovery For Log-based File Systems Over Flash Memory Chin-Hsien WU and Tei-Wei KUO;Li-Pin CHAN National Taiwan University; National Chiao-Tung University

Upload: flashdomain

Post on 05-Jul-2015

328 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Ayse Ozturk Sunum (0,2 MB)

The Design Of Efficient Initialization And Crash Recovery For Log-based File Systems Over Flash Memory

Chin-Hsien WU and Tei-Wei KUO;Li-Pin CHANNational Taiwan University;National Chiao-Tung University

Page 2: Ayse Ozturk Sunum (0,2 MB)

Flash technology considerations

Performance->Quick mounting/unmountingEffective garbage collection Reliability->Efficient roll-backİnitialization and crash recovery

Page 3: Ayse Ozturk Sunum (0,2 MB)

Why Flash Memory?

Non-volatile Shock-resistant Power-economic Affordable capacity Suitable to mobile devices due to

less energy need and better vibration tolerance

Page 4: Ayse Ozturk Sunum (0,2 MB)

Features:

Write-once: updates to existing data on a page are only possible after an erase operation

No in-place updates Out-place updates preferred for

performance and endurance

Page 5: Ayse Ozturk Sunum (0,2 MB)

Different implementations

NFS(Native File System):JFFS/2,LFM,YAFFS/2*Access to files by vaiable sized records

with (file-id and file-offset) pairs Block-emulation approach:FTL/Lite,CompactFlash,SmartMedia*Access to files by indexes of LBA(Logical

Block Addresses) and RAM resident address translation tables

Page 6: Ayse Ozturk Sunum (0,2 MB)

Mounting time:

Most important design consideration Mount:scanning all spare areas of

pages to reconstruct house-keeping data structures in main memory

Time consuming Will be impractical soon

Page 7: Ayse Ozturk Sunum (0,2 MB)

Alternative way

Snapshot of entire housekeeping data structure

Speed up initialization What if crash or improper

unmounting?

Page 8: Ayse Ozturk Sunum (0,2 MB)

Proposed Solution

Log Management Scheme via Log-Record Manager(LRM) and Logger

For initialization and crash recovery scan check regions instead of all spare areas.

Page 9: Ayse Ozturk Sunum (0,2 MB)

LRM

Collect log-records in main memory Write/Update to files Merge/Delete as necessary

Page 10: Ayse Ozturk Sunum (0,2 MB)

Logger

Commit=write to flash memory log-records via check regions data structures

Page 11: Ayse Ozturk Sunum (0,2 MB)

Check regions

=#log segments and a log segment directory

Segments in size of a block

Page 12: Ayse Ozturk Sunum (0,2 MB)

Log-segment directory

Organization of check regions

Page 13: Ayse Ozturk Sunum (0,2 MB)

Visual representation-see article

Page 14: Ayse Ozturk Sunum (0,2 MB)

Related work

Effective garbage collection->cost-benefit policy by value-driven heuristic function

Periodically move live data among blocks to increase even erase counts

Adopt SRAM as write buffers, several cleaning polic,es Interrupt emulation mechanism to reduce interference

of IO on user tasks Layers for index processing Space efficient search-tree like structure for address

translation In-memory file system metadata(inode and

cache)during unmounting write to flash memory. If crash occurs, all spare areas need to be scanned Closest work to writer’s methodology

Page 15: Ayse Ozturk Sunum (0,2 MB)

Problem Formulation

Characteristics: NAND flash No overwrite->new data is written to free space-

>invalidate previous which is called dead Block recycling policy minimize overhead due to

live pages 1 million erase counts max, then frequent write

errors Wear levelling->evenly erase blocks to increase

lifetime Wear-levelling if strong locality on updates causes

too much overhead

Page 16: Ayse Ozturk Sunum (0,2 MB)

Initialization and Crash Recovery

Logical address space o by LBA(Logical Block Address) index for block-device emulation via RAM-

resident translation tables->mounting:rebuilt by scanning all spare areas

o by (file id,offset pairs)for NFS->variable sized records to show writes/updates;hiearchical ds-tree in main memory to reflect updates;scan to construct logical view

Page 17: Ayse Ozturk Sunum (0,2 MB)

Problem

Scan time is intolerable to many users

Snapshot does not work well in case of crash and cause lengthy shut down procedure due to large fle size

Page 18: Ayse Ozturk Sunum (0,2 MB)

Solution

NFS is adapted in the solution which could be extended for block-emulation type.

NFS->writes, updates in sequential style(by appending)

BMI(back-up memory image) by scanning spare areas

PMI(primary memory image) by scanning check regions and stored in main memory

Additional log records are allowed as metadata about write/update operations on continous segment with starting offset and size

Page 19: Ayse Ozturk Sunum (0,2 MB)

System architecture

Page 20: Ayse Ozturk Sunum (0,2 MB)

Efficient Crash Recovery

Writes must be in appending fashion even inside a block

Committing log records in-order is required for the mechanism

Version tags to track the recency of data

In case of crash most recent and most consistent check region is used for recovery

Page 21: Ayse Ozturk Sunum (0,2 MB)

Intelligent scan

If first page of block is free, then skip the rest which is free due to in-order commitment policy

If metadata match some check region, then skip that part since already exists

Skipping some parts intelligently based on above logic reduces crash recovery time and provides better performance.

Page 22: Ayse Ozturk Sunum (0,2 MB)

Performance

Performance measurements with different metrics, ratio, buffer size and crash recovery scenarios show that the solution is efficient and has good performance on different cases.

Page 23: Ayse Ozturk Sunum (0,2 MB)

Conclusion

Reconstruction via check regions Reduce crash recovery time Improve initialization time with less

overhead Log-management scheme works

well…

Page 24: Ayse Ozturk Sunum (0,2 MB)

Future Work

More performance enhancement Even less overhead