22
ELF: An Efficient Log- Structured Flash File System For Micro Sensor Nodes Hui Dai, Michael Neufeld, Richard Han Presenter Yamuna Krishnamurthy

ELF: An Efficient Log-Structured Flash File System For Micro

Embed Size (px)

Citation preview

Page 1: ELF: An Efficient Log-Structured Flash File System For Micro

ELF: An Efficient Log-Structured Flash File System For Micro Sensor Nodes

Hui Dai, Michael Neufeld, Richard Han

PresenterYamuna Krishnamurthy

Page 2: ELF: An Efficient Log-Structured Flash File System For Micro

Sensor Node Memory Usage

Page 3: ELF: An Efficient Log-Structured Flash File System For Micro

Existing File Systems

File System Type

Characteristics Example

Log Structured Represented as a log of metadataData gathered in cache before writing to disk

Sprite LFS, BSD-LFS

Flash Large flash memorySmall battery backed SRAM for write bufferingLarge bandwidth bus between RAM and SRAMAllows garbage collection

eNVy,MFFS,JFFS

Distributed Data Storage

Distributed event storage using geographic hash table

DCS, Dimension

Micro Sensor Storage

Work with sensor flash storage on each sensor nodeProvide efficient, reliable complete file operations

Matchbox, ELF

Page 4: ELF: An Efficient Log-Structured Flash File System For Micro

Flash Memory Characteristics

Most common storage medium for micro sensors

Flash is divided into sectors (sector = n* 264byte page)

On-chip cache (264 bytes) Concurrent read/writes

prohibited Flash pages have limited life Reliability mechanisms like

logging can either use Flash or EEPROM as is done for ELF’s implementation on Mica2 mote

Page 5: ELF: An Efficient Log-Structured Flash File System For Micro

Sensor Data Types and Their Characteristics

Sensor Data Form major part of the data stored Data written sequentially without modifying earlier

records Cleared periodically

Configuration Data Changes infrequently after deployment Require high reliability for proper sensor functioning

Binary Program Images Dynamic reprogramming of sensor nodes with either

a complete new binary image or patches Store the binary image in flash memory before

rebooting the system Requires high reliability

Page 6: ELF: An Efficient Log-Structured Flash File System For Micro

ELF Design Goals

Allow access to flash memory with simple file operations like write-modify,write-append,reading,creation and deletion

Extend the operational lifetime of the flash with wear leveling

Achieve a small memory footprint Optimize common sensor file operations Avoid excessive energy consumption Provide optional best-effort data

reliability

Page 7: ELF: An Efficient Log-Structured Flash File System For Micro

ELF File System Architecture

Resource Abstraction Run-time memory In-memory representation of

open files Configuration data like

cleaning policy General File Operations

Logical abstraction of file/dir operation

ELF Maintenance Tasks System maintenance tasks

like snapshot of dir structure and file meta data in EEPROM

Page 8: ELF: An Efficient Log-Structured Flash File System For Micro

Data Structures in RAM, EEPROM and FLASH

Page 9: ELF: An Efficient Log-Structured Flash File System For Micro

Flash Data Structures

Physical Nodes Meta-Data

Unique 16-bit node identifier

16-bit version number indicating age

32-bit field storing length of the node and included data

Types ELF_DIR – Represents a

dir entry in the file system

ELF_FILE – Includes meta-data to operate on file

ELF_COMMON – Represents changes to the file

Per-Page Meta Data

struct page_info{ uint16_t crc; uint16_t nextPage:11; uint16_t flags:5; uint16_t writeEncounter; uint16_t magicNumber;}

Page 10: ELF: An Efficient Log-Structured Flash File System For Micro

In-Memory Data Structures

File Abstraction Node

Abstraction File Descriptor

Page 11: ELF: An Efficient Log-Structured Flash File System For Micro

In-EEPROM Data Structures

Cache dir structure for fast file access

Store system snapshot to enable file consistency

Allows fast startup or system reboot

Allows crash recovery

Page 12: ELF: An Efficient Log-Structured Flash File System For Micro

File Operations in ELF

Open/Create Append Modify

Read/Seek Rename Delete

Page 13: ELF: An Efficient Log-Structured Flash File System For Micro

ELF Flash Memory Operations

Read Flash->Data Flash->Cache->Data

Write Data->Cache->Flash Page contents erased before writing

Modify Page ->Cache->Modify->Flash

Page 14: ELF: An Efficient Log-Structured Flash File System For Micro

Resource Management

Bitmap approach to maintain free/dirty used blocks

Garbage Collection Cleaner called

when number of free pages drop below threshold

Page 15: ELF: An Efficient Log-Structured Flash File System For Micro

Crash Recovery

Optional Checkpoint Roll Forward Maintains snapshots of current

operation {inodeNum,action,curr_version,highest_version}

Page 16: ELF: An Efficient Log-Structured Flash File System For Micro

Performance Results

Sequential Read Performance Elf reads data

directly from flash whereas matchbox reads from flash to cache and then reads the data

Page 17: ELF: An Efficient Log-Structured Flash File System For Micro

Performance Results

M corresponds to maximum write throughput or memory consumption of matchbox

Experiments performed with varying RAM buffer

E1 and E1’ correspond to 0 byte buffer, E2 and E2’ correspond to 32 byte buffer and so on

E1 has the whole bitmap stored in RAM whereas E1’ has only first 64 bytes stored in RAM

Sequential Write Throughput

Sequential Write Memory Consumption

Page 18: ELF: An Efficient Log-Structured Flash File System For Micro

Performance Results

Random Read Performance

Random Write Performance

Page 19: ELF: An Efficient Log-Structured Flash File System For Micro

Performance Results

Wear Leveling Performance

Page 20: ELF: An Efficient Log-Structured Flash File System For Micro

Conclusion

Provides complete,efficient and reliable file system for micro sensor nodes

Uses atomic write operations for operating with file metadata

Support for simple garbage collection Optional best effort crash recovery

mechanism Achieves wear leveling Allows random access of data

Page 21: ELF: An Efficient Log-Structured Flash File System For Micro

Limitations and Future Work

Cannot handle frequent occurrences of reboot, file open and creation

Loss of reliability due to write buffering

Energy and latency cost of ensuring reliability not explored

Using compression mechanisms to reduce memory usage

Page 22: ELF: An Efficient Log-Structured Flash File System For Micro

THANK YOU