1、ELF: An Efficient Log-Structured Flash File System For Micro Sensor Nodes,By Hui Dai, Michael Neufeld, Richard Han,Talk given by Mingqu Yue,Outline,Backgrounds Design Overview Implementation Data structures File operations Garbage collection Crash recovery Performance Evaluation,Design Overview,Desi
2、gn Objectives Characteristics of data that are expected to handle Persistent storage attributes on sensor nodes Log-Structured File System Techniques in ELF ELF Architecture Overview,Objectives,To provide a practical, efficient and reliable file system for micro sensor nodes that employ flash memory
3、 for persistent storage.,Characteristics of data that are expected to handle,Sensor data The majority of the data Written sequentially (append) Configuration data Will experience modification and updates Demands higher level of reliability Binary program image Requires the highest level of reliabili
4、ty,Persistent Storage attributes on Sensor Nodes,Two kinds of persistent storage mediums are used in sensor nodes Flash memory - storing sensor data, metadata and etc. EEPROM storing the directory structure and crash recovery data,Log-Structured File System Techniques in ELF,Traditional LFS:,creates
5、 a new sequential log entry for each write operation,Very good wear leveling,many small appends will rapidly make memory representation grow to unwieldy size.,LFS Techniques in ELF,Write-Append operations: utilize an existing log entry on a flash page if one is available For reliability consideratio
6、ns, ELF keeps each log entry on a separate flash page Write-Modify operations: modifications will be written to a new page and a log entry is created. Other standard file operations, not sophisticated,ELF Architecture Overview,Resource Abstraction: in-memory representations of open files, cleaning p
7、olicy and other configuration data General File Operations: logical abstraction of all file/directory operations. ELF Maintenance Tasks: maintaining a snapshot of directory structure and file metadata in EEPROM, garbage collection task.,Implementation,On-Flash Data Structures In-Memory Data Structur
8、es In-EEPROM Data Structures and Related Operations File Operations in ELF Resource Management and Garbage Collection Crash Recovery,On-Flash Data Structures,Physical Nodes The log in ELF consists of a sequence of physical nodes. ELF_DIR: a directory entry ELF_FILE: metadata, file content. ELF_COMMO
9、N: a write modification, a deletion operation, or a renaming operation Each flash page contains at most one physical node Per-Page Metadata,In-Memory Data Structures,File Abstraction Stores the metadata of the file Such as the length of the file, number of opened handles, and a pointer to the list o
10、f physical node abstractions. Node Abstraction Each physical node of the file on flash has a corresponding abstraction in RAM. Only contains the necessary summary information of the physical node,In-EEPROM Data Structures,ELF caches its directory in EEPROM for access to files Also stores a snapshot
11、of the system in EEPROM,Fast startup and crash recovery,File Operations in ELF,Open file “foo” Examine whether “foo”s file abstraction is in RAM Create file Allocate a free flash page Create a physical node Create file abstraction and physical node abstraction in RAM Assigning a file descriptor to t
12、he application,File Operations in ELF,Append Policy: delaying updates to a files physical node on the flash given a sequence of appends,File Operations in ELF,Write(modify) Allocates a new flash page and created a new physical node Creates the corres-ponding new node abstraction in RAM and appends i
13、t to the node abstraction list,File Operations in ELF,Read/Seek Uses two pointers to read If the log is long, then the performance of the read operation will degrade.,File Operations in ELF,Rename Renaming a file Creating a new physical node and corresponding node abstraction Renaming a directory A
14、new directory node is allocated All data structures within the old directory node are copied to the new node,File Operations in ELF,Deletion Adding a physical node to indicate the delete status The allocated space will be reclaimed during garbage collection,Resource Management and Garbage Collection
15、,Resource Management Traditional approach: block list ELF approach: bitmap,Improved approach: the newly allocated blocks are combined with existing blocks if possible,Resource Management and Garbage Collection,Garbage Collection The number of free pages is tracked The cleaner reclaims the pages occu
16、pied by deleted, renamed or obsolete files. If the space is still not enough, de-fragmenting file to reclaim more pages RAM consumption is fairly low: 10bytes without defragmentation and fewer than 40 bytes with it.,Crash Recovery,Checkpoints only store the status of a file. It is not enough, so we
17、need tracking the current operation and a list of past operations (snapshot)When the system crashes, ELF compares the last finished action and the current action, if they match and CRC checksum is correct, then the file will be confirmed. Otherwise, roll back.,Performance Evaluation (compared with M
18、atchbox),Sequential Read Performance Sequential Write Performance Random Read Performance Random Write Performance Wear Levelling Performance Energy Consumption,Sequential Read Performance,First filled the entire memory with a 500 KB log file and the performed sequential reads,Sequential Write Perfo
19、rmance,Appending 16 bytes of sensor data to the file in each write until the whole flash is consumed,Sequential Write Memory Consumption,Sequential Write Throughput,Random Read Performance,read a portion of the data in the middle of the log,Random Write Performance,First write a 100 KB log file to t
20、he flash, then a portion of the file is randomly selected and overwritten with 0-300KB of new data,Wear Levelling Performance,The experiments runs on 2000 256-byte pages continues running until the total number of erasures exceeds 10,240,000,Future work,Issues like frequent occurrence of rebooting , file opening and creation Caching writes enhance the risk of data loss A more detailed study of the reliability needed Implementing a suitable compression algorithm for sensor data,Thank you!,