IRON for JFFS2 Presented by: Abhinav Kumar Raja Ram Yadhav Ramakrishnan.

Slides:



Advertisements
Similar presentations
DISK FAILURES PROF. T.Y.LIN CS-257 Presenter: Shailesh Benake(104)
Advertisements

CS 346 – April 4 Mass storage –Disk formatting –Managing swap space –RAID Commitment –Please finish chapter 12.
The google file system Cs 595 Lecture 9.
0 秘 Type of NAND FLASH Discuss the Differences between Flash NAND Technologies: SLC :Single Level Chip MLC: Multi Level Chip TLC: Tri Level Chip Discuss:
Predictable Computer Systems Remzi Arpaci-Dusseau University of Wisconsin, Madison.
Allocation Methods - Contiguous
Memory CS423 Dick Steflik. DRAM Dynamic Random Access Memory  each data bit is stored in a separate capacitive element in the Integrated Circuit  Because.
Real-Time Library: Flash File System 1. Flash File System - Basics – The RL-FlashFS allows to create, save, read and modify files – The library functions.
Avishai Wool lecture Introduction to Systems Programming Lecture 8.3 Non-volatile Memory Flash.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
1 File Management in Representative Operating Systems.
Embedded Real-Time Systems Design Selecting memory.
Linux Operating System
RAID Systems CS Introduction to Operating Systems.
Servers Redundant Array of Inexpensive Disks (RAID) –A group of hard disks is called a disk array FIGURE Server with redundant NICs.
Solid State Drive Feb 15. NAND Flash Memory Main storage component of Solid State Drive (SSD) USB Drive, cell phone, touch pad…
Storage System: RAID Questions answered in this lecture: What is RAID? How does one trade-off between: performance, capacity, and reliability? What is.
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
Swaminathan Sundararaman, Yupu Zhang, Sriram Subramanian, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
1 Solid State Storage (SSS) System Error Recovery LHO 08 For NASA Langley Research Center.
File system support on Multi Level Cell (MLC) flash in open source April 17, 2008 Kyungmin Park Software Laboratories Samsung Electronics.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Making a Phone Call with Phase Change Memory Justin Treon Embedded Linux Conference Session W-130-C April 15, 2008.
Seminar on Linux-based embedded systems
Motivation SSDs will become the primary storage devices on PC, but NTFS behavior may not suitable to flash memory especially on metadata files. When considering.
Multiple Device Driver and Flash FTL Sarah Diesburg COP 5641.
A Software Layer for Disk Fault Injection Jake Adriaens Dan Gibson CS 736 Spring 2005 Instructor: Remzi Arpaci-Dusseau.
Presenter : kilroy 1. Introduction Experiment 1 - Simulate a virtual disk device Experiment 2 - Nand-flash simulation for wear leveling algo. Conclusion.
Reliability and Recovery CS Introduction to Operating Systems.
Using Model Checking to Find Serious File System Errors StanFord Computer Systems Laboratory and Microsft Research. Published in 2004 Presented by Chervet.
File System Implementation
Semantically-Smart Disk Systems Muthian Sivathanu, Vijayan Prabhakaran, Florentina Popovici, Tim Denehy, Andrea Arpaci-Dusseau, Remzi Arpaci-Dusseau University.
- Disk failure ways and their mitigation - Priya Gangaraju(Class Id-203)
1 SQCK: A Declarative File System Checker Haryadi S. Gunawi, Abhishek Rajimwale, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau University of Wisconsin.
EXT2C: Increasing Disk Reliability Brian Pellin, Chloe Schulze CS736 Presentation May 3 th, 2005.
Lecture 22 SSD. LFS review Good for …? Bad for …? How to write in LFS? How to read in LFS?
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
CSE 451: Operating Systems Section 9: Storage; networks.
FTOP: A library for fault tolerance in a cluster R. Badrinath Rakesh Gupta Nisheeth Shrivastava.
Linux Kernel Development Memory Management Pavel Sorokin Gyeongsang National University
Disk Failures Skip. Index 13.4 Disk Failures Intermittent Failures Organizing Data by Cylinders Stable Storage Error- Handling.
MTD overview MTD subsystem (stands for Memory Technology Devices)
XIP – eXecute In Place Jiyong Park. 2 Contents Flash Memory How to Use Flash Memory Flash Translation Layers (Traditional) JFFS JFFS2 eXecute.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 3: Windows7 Part 3.
WSRR 111 Coerced Cache Eviction and Discreet Mode Journaling: Dealing with Misbehaving Disks Abhishek Rajimwale, Vijay Chidambaram, Deepak Ramamurthi Andrea.
Lecture 11: Storage Systems Disk, RAID, Dependability Kai Bu
CS Introduction to Operating Systems
File System Consistency
Jonathan Walpole Computer Science Portland State University
Understanding Modern Flash Memory Systems
What you should know about Flash Storage
Transactions and Reliability
Work-in-Progress: Full-Datapath Secure Deletion
Operating System I/O System Monday, August 11, 2008.
An Adaptive Data Separation Aware FTL for Improving the Garbage Collection Efficiency of Solid State Drives Wei Xie and Yong Chen Texas Tech University.
RAID RAID Mukesh N Tekwani
An overview of the kernel structure
Chapter 3: Windows7 Part 3.
Overview Continuation from Monday (File system implementation)
Outline Allocation Free space management Memory mapped files
RAID Redundant Array of Inexpensive (Independent) Disks
UNIT IV RAID.
Overview: File system implementation (cont)
Use ECP, not ECC, for hard failures in resistive memories
Lecture 11: Flash Memory and File System Abstraction
RAID RAID Mukesh N Tekwani April 23, 2019
Lecture 29: File Systems (cont'd)
Presentation transcript:

IRON for JFFS2 Presented by: Abhinav Kumar Raja Ram Yadhav Ramakrishnan

Motivation: Among the current flash file systems the foll two are dominant: 1. JFFS (Journaling Flash File system) 2. YAFFS(Yet Another Flash File system) Flash Storage is being increasingly used in the internal memory of Smart Phones IRON-like analysis has not been on Flash File Systems

Why an IRON-like analysis ?: Same pseudo-driver can be used to study other Flash File systems too Tests performed without modifying file system code

NAND Storage Basics: A page consists of 256 / 512 Byte data and 8 / 16 Byte spare (out of band) area Memory is arranged as an array of pages The spare area is used to store ECC (error correction code), bad block information and filesystem-dependent data Wear leveling is needed

Some Flash File system Basics: Flash doesn't match the description of either block or char devices A special device called “MTD” was created Differences between flash and block devices

Flash File system Basics continued… USB Flash Drives, SD Cards also treated as Block Devices File Translation Layer(FTL) needed to use traditional File Systems like ext2 on MTD devices Why we shouldn’t use FTL…..

Flash Storage Stack:

About JFFS2: Log Structured File System to enable write leveling On-the-fly compression and decompression Uses Cleanmarkers to indicate whether a block was successfully erased 0x080x090x0a0x0b0x0c0x0d0x0e0x0f 0x850x190x030x200x080x00

High-level implementation details: NAND simulator (nandsim) Provided us with a useful interface to simulate faults Used the interfaces to conduct several “IRON” like tests

Tests Performed: JFFS2 Pseudo-Driver Read Failure (single bit) Read Failure (multiple bits) Write Failure Erase Failure Write Failure during GC Read Failure of entire block

Progress table Test Performed Error Detected? Recovered from Error? Comments

JFFS2 Pseudo-Driver Read Failure (entire page) ReadPropagate an error code JFFS2 error: (10411) jffs2_get_inode_nodes: can not read 512 bytes from 0x01ff8200, error code: -1. JFFS2 error: (10411) jffs2_do_read_inode_internal: cannot read nodes for ino 2, returned error is -1 Returned error for crccheck of ino #2. Expect badness... Kernel Error Message Observed:

Progress table Test Performed Error Detected ? Recovered from Error? Comments Read Failure (entire page) Error Propagation but no retry

JFFS2 Pseudo-Driver Read Failure (single bit) Read Flipped one bit just before reading Observation Successful detection and correction

Progress table Test Performed Error Detected ? Recovered from Error? Comments Read Failure (entire page) Error Propagation but no retry Read Failure (single bit) Error was detected and also corrected using checksum

JFFS2 Pseudo-Driver Read Failure (multiple bits) ReadFlipped more than a bit JFFS2 notice: (8889) read_dnode: wrong data CRC in data node at 0x01ff8200: read 0x1aaee62e, calculated 0x6cae3da6. Kernel Error Message Observed:

Progress table Test Performed Error Detected? Recovered from Error? Comments Read Failure (entire page) Error Propagation but no retry Read Failure (single bit) Error was detected and also corrected using checksum Read Failure (multiple bits) Error detection No error correction No error propagation No retry

Why?: static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, struct jffs2_raw_inode *rd, int rdlen, struct jffs2_readinode_info *rii) { int ret = 0; ******** if (len >= csize && unlikely(tn->partial_crc != je32_to_cpu(rd- >data_crc))) { JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc)); jffs2_mark_node_obsolete(c, ref); goto free_out; } ********** free_out: jffs2_free_tmp_dnode_info(tn); return ret; }

JFFS2 Pseudo-Driver Write Failure WriteReturned an Error Infinte retry leading to kernel crash Observation:

Progress table Test Performed Error Detected? Recovered from Error? Comments Read Failure (entire page) Error Propagation but no retry Read Failure (single bit) Error was detected and also corrected using checksum Read Failure (multiple bits) Error detection No error correction No error propagation No retry Write FailureError Propagation and infinite retry

Why?: int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino) { ****** while (old_wbuf_len && old_wbuf_ofs == c->wbuf_ofs) { mutex_unlock(&c->alloc_sem); D1(printk(KERN_DEBUG "jffs2_flush_wbuf_gc() calls gc pass\n")); ret = jffs2_garbage_collect_pass(c); if (ret) { /* GC failed. Flush it with padding instead */ mutex_lock(&c->alloc_sem); down_write(&c->wbuf_sem); ret = __jffs2_flush_wbuf(c, PAD_ACCOUNTING); /* retry flushing wbuf in case jffs2_wbuf_recover left some data in the wbuf */ if (ret) ret = __jffs2_flush_wbuf(c, PAD_ACCOUNTING); up_write(&c->wbuf_sem); break; } *****

Progress table in GC path Test Performed Error Detected? Recovered from Error? Comments

JFFS2 Pseudo-Driver Erase Failure EraseReturned an Error Kernel Error Message Observed: Erase at 0x01ffc000 failed immediately: errno -1 No space left on device

Progress table in GC path Test Performed Error Detected? Recovered from Error? Comments Erase FailureError propagation but no retry

JFFS2 Pseudo-Driver Write Failure in GC path: Write during GC Returned an Error Observation: Infinite retry observed because of the same reason

Progress table in GC path Test Performed Error Detected? Recovered from Error? Comments Erase FailureError propagation but no retry Write FailureInfinite retry with kernel crash

Test Performed Error Detected? Recovered from Error? Comments Read Failure (entire page) Error Propagation but no retry Read Failure (single bit) Error was detected and also corrected using checksum Read Failure (multiple bits) Error detection No error correction No error propagation No retry Write FailureError Propagation and infinite retry Erase FailureError Propagation but no retry Write Failure in GC path Infinite retry with kernel crash

Conclusion: It has many favorable characteristics: 1. On-the-Fly Compression and Decompression 2. Checksumming 3. Good Recovery techniques like Error propagation, retry on most cases Several tests were performed on JFFS2 However the recovery technique isnt apt in some cases like Read Failure(multiple bits), Write failure

Future Work: Failure of specific metadata blocks such as i-node, i-node map etc Further exploration of the GC path

References: IRON File Systems By Vijayan Prabhakaran, Nitin Agrawal, Lakshmi Bairavasundaram, Haryadi Gunawi, Andrea C. Arpaci-Dusseau and Remzi H. Arpaci-Dusseau JFFS : The Journalling Flash File System By David Woodhouse, Red Hat Inc. Essential Linux Device Drivers by Sreekrishnan Venkateswaran Linux Device Drivers, Third Edition Jonathan Corbet, Alessandro Rubini,Greg Kroah-Hartman

Acknowledgements: Special thanks to Prof. Remzi Arpaci-Dusseau for giving us a chance to work on this project

Questions?