Flash storage technology

Slides:



Advertisements
Similar presentations
COEN 180 Flash Memory.
Advertisements

Flash storage memory and Design Trade offs for SSD performance
Thank you for your introduction.
+ CS 325: CS Hardware and Software Organization and Architecture Internal Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
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:
COEN 180 DRAM. Dynamic Random Access Memory Dynamic: Periodically refresh information in a bit cell. Else it is lost. Small footprint: transistor + capacitor.
11/29/2004EE 42 fall 2004 lecture 371 Lecture #37: Memory Last lecture: –Transmission line equations –Reflections and termination –High frequency measurements.
Other Disk Details. 2 Disk Formatting After manufacturing disk has no information –Is stack of platters coated with magnetizable metal oxide Before use,
Embedded Real-Time Systems Design Selecting memory.
1 Lecture 14: DRAM, PCM Today: DRAM scheduling, reliability, PCM Class projects.
CSE 451: Operating Systems Winter 2010 Module 13 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura.
Operating Systems COMP 4850/CISG 5550 Disks, Part II Dr. James Money.
Yu Cai1, Erich F. Haratsch2 , Onur Mutlu1 and Ken Mai1
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Lecture on Electronic Memories. What Is Electronic Memory? Electronic device that stores digital information Types –Volatile v. non-volatile –Static v.
Storage Systems: Advanced Topics Learning Objectives: To understand major characteristics of SSD To understand Logical Volume Management – its motivations.
File system support on Multi Level Cell (MLC) flash in open source April 17, 2008 Kyungmin Park Software Laboratories Samsung Electronics.
Chapter 10 Storage and File Structure Yonsei University 2 nd Semester, 2013 Sanghyun Park.
Lecture 9 of Advanced Databases Storage and File Structure (Part II) Instructor: Mr.Ahmed Al Astal.
2010 IEEE ICECS - Athens, Greece, December1 Using Flash memories as SIMO channels for extending the lifetime of Solid-State Drives Maria Varsamou.
Thomas coughlin Those slides which are signed by “ * Were not in the main document. these slide are just gathered for better understanding.
Lecture 16: Storage and I/O EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
Digital Design: Principles and Practices
Reliability and Recovery CS Introduction to Operating Systems.
Embedded System Lab. Daeyeon Son Neighbor-Cell Assisted Error Correction for MLC NAND Flash Memories Yu Cai 1, Gulay Yalcin 2, Onur Mutlu 1, Erich F. Haratsch.
IRON for JFFS2 Presented by: Abhinav Kumar Raja Ram Yadhav Ramakrishnan.
Lecture 22 SSD. LFS review Good for …? Bad for …? How to write in LFS? How to read in LFS?
Carnegie Mellon University, *Seagate Technology
Data Retention in MLC NAND FLASH Memory: Characterization, Optimization, and Recovery. 서동화
CS399 New Beginnings Jonathan Walpole. Disk Technology & Secondary Storage Management.
Carnegie Mellon University, *Seagate Technology
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.
Norhayati Soin 06 KEEE 4426 WEEK 15/1 6/04/2006 CHAPTER 6 Semiconductor Memories.
NAND Chip Driver Optimization and Tuning
Memory and Programmable Logic
Prof. Hsien-Hsin Sean Lee
Internal Parallelism of Flash Memory-Based Solid-State Drives
RAID.
COS 518: Advanced Computer Systems Lecture 8 Michael Freedman
Understanding Modern Flash Memory Systems
What you should know about Flash Storage
Disks and RAID.
Aya Fukami, Saugata Ghose, Yixin Luo, Yu Cai, Onur Mutlu
Operating System I/O System Monday, August 11, 2008.
Operating Systems ECE344 Lecture 11: SSD Ding Yuan
Flash Disk Technology Stop the Spin!
NOVA: A High-Performance, Fault-Tolerant File System for Non-Volatile Main Memories Andiry Xu, Lu Zhang, Amirsaman Memaripour, Akshatha Gangadharaiah,
Information Storage and Spintronics 09
Vulnerabilities in MLC NAND Flash Memory Programming: Experimental Analysis, Exploits, and Mitigation Techniques Yu Cai, Saugata Ghose, Yixin Luo, Ken.
COS 518: Advanced Computer Systems Lecture 8 Michael Freedman
BIC 10503: COMPUTER ARCHITECTURE
Memory.
Semiconductor Memories
Lecture 6: Reliability, PCM
CSE 451: Operating Systems Winter 2009 Module 13 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
Jonathan Walpole Computer Science Portland State University
RAID Redundant Array of Inexpensive (Independent) Disks
Mark Zbikowski and Gary Kimura
CSE 451: Operating Systems Winter 2012 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
2.C Memory GCSE Computing Langley Park School for Boys.
Use ECP, not ECC, for hard failures in resistive memories
CSE451 Virtual Memory Paging Autumn 2002
Lecture 11: Flash Memory and File System Abstraction
CS333 Intro to Operating Systems
Lecture 5 Memory and storage
COS 518: Advanced Computer Systems Lecture 9 Michael Freedman
Yu Cai, Yixin Luo, Erich F. Haratsch, Ken Mai, Onur Mutlu
Disks Magnetic (hard) Disk arrays are used for reliable storage (RAID)
Presentation transcript:

Flash storage technology Arnout Vandecappelle arnout@mind.be Updated slides can be found at http://mind.be/content/Presentation_Flash-technology-ELCE16.odp © 2016 Essensium N.V. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 Unported License

Flash storage technology Workarounds to make flash work Arnout Vandecappelle – Essensium/Mind

Flash storage technology How flash fails to work Workarounds to make flash work Arnout Vandecappelle – Essensium/Mind

Flash storage technology How flash works How flash fails to work Workarounds to make flash work Arnout Vandecappelle – Essensium/Mind

Flash storage technology How flash works How flash fails to work Workarounds to make flash work This is just my internet research Arnout Vandecappelle – Essensium/Mind

This presentation is about: NAND flash MLC cell How flash works This presentation is about: NAND flash MLC cell Small technology nodes (16nm) Arnout Vandecappelle – Essensium/Mind

Driver: $ per bit NAND flash is cheap Developed for SD cards and SSD Chips we get for embedded are a by-product Compared to HDD, speed is not an issue Compared to HDD, power is not an issue Reliability is not measurable Arnout Vandecappelle – Essensium/Mind

How flash works Basic cell structure Reading Programming Erasing Arnout Vandecappelle – Essensium/Mind

The Electrically Erasable Programmable ROM cell How flash works The Electrically Erasable Programmable ROM cell Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor gate source drain body bulk Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor conductor “metal” insulator “oxide” = SiO2 semiconductor Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor V e- e- holes Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor V V holes Arnout Vandecappelle – Essensium/Mind

Back to basics The transistor V V Arnout Vandecappelle – Essensium/Mind

A transistor with memory V V Arnout Vandecappelle – Essensium/Mind

A transistor with memory V V e- Arnout Vandecappelle – Essensium/Mind

Combining cells in NAND Extremely dense structure Peripheral circuits optimised away Easy to scale Arnout Vandecappelle – Essensium/Mind

Combining cells in NAND String of 32 cells 16896 strings = 32 * 2112 bytes = 32 pages Arnout Vandecappelle – Essensium/Mind

Increasing density: MultiLevel Cell (MLC) empty cell passes @0V full cell blocks @0V = Single Level Cell (SLC) only 1 threshold voltage Arnout Vandecappelle – Essensium/Mind

Increasing density: MultiLevel Cell (MLC) half cell passes @3V half cell blocks @0V 3V 0V V V e- e- e- e- Arnout Vandecappelle – Essensium/Mind

Increasing density: MultiLevel Cell (MLC) Arnout Vandecappelle – Essensium/Mind

MultiLevel Cell has several threshold voltages 11 10 01 00 Vth REF1 REF2 REF3 Erased Fully programmed 2 bits 3 levels 3 bits 7 levels 4 bits 15 levels 5 bits 31 levels 6 bits 63 levels Arnout Vandecappelle – Essensium/Mind

MLC pages are often interleaved Odd/even pages on separate bitlines Page N and N+6 on same wordline Upper page always before lower page 22 23 18 19 20 21 14 15 16 17 10 11 12 13 6 7 8 9 2 3 4 5 1 Arnout Vandecappelle – Essensium/Mind

How flash works Reading Arnout Vandecappelle – Essensium/Mind

Reading a cell Bitlines read in parallel Measure current Bitlines Drain select Word lines Source select Arnout Vandecappelle – Essensium/Mind

Bypass the floating gate with higher voltage Arnout Vandecappelle – Essensium/Mind

Reading a cell Bitlines precharged V V V Bitlines precharged Non-selected wordlines strongly enabled Selected wordline normally enabled If cell is erased (1) bitline discharges V 6V 6V 6V 6V 6V V Arnout Vandecappelle – Essensium/Mind

NAND structure is like CMOS NAND gate B Q 1 V V V V or 0 V V V Q A V B V Arnout Vandecappelle – Essensium/Mind

Reading a MultiLevel Cell Upper page 11 10 01 00 Vth REF1 REF2 REF3 Erased Fully programmed Read @REF2 Arnout Vandecappelle – Essensium/Mind

Reading a MultiLevel Cell Lower page requires 2 reads 11 10 01 00 Vth REF1 REF2 REF3 Erased Fully programmed REF1 REF3 OUT 1 Read @REF3 Store as S1 Read @REF1 Output S1 OR S2 Arnout Vandecappelle – Essensium/Mind

How flash works Programming Arnout Vandecappelle – Essensium/Mind

Programming the floating gate: Fowler-Nordheim tunnelling 20V Arnout Vandecappelle – Essensium/Mind

Inhibit programming to keep at 1 20V 8V Field not strong enough to enable tunnelling Arnout Vandecappelle – Essensium/Mind

Bypass non-programmed wordlines 12V > 8V Arnout Vandecappelle – Essensium/Mind

Programming a cell Non-selected wordlines strongly enabled V V Non-selected wordlines strongly enabled Selected wordline very strongly enabled V 12V 12V 20V 12V 12V 12V V Arnout Vandecappelle – Essensium/Mind

Number of electrons is stochastically distributed VT VT e- Arnout Vandecappelle – Essensium/Mind

Program in pulses to narrow distribution VT VT e- Arnout Vandecappelle – Essensium/Mind

Program MLC by pulsing and sensing 11 10 01 00 Vth REF1 REF2 REF3 Erased Fully programmed Sense during pulse off Increasing V Stop when REF is reached → inhibit Each bitline individually 16-20V 0V ↓ 8V Arnout Vandecappelle – Essensium/Mind

Program MLC Upper page – Lower page REF2 1 First program upper page Vth Additional program lower page 11 10 01 00 Vth REF1 REF2 REF3 Erased Fully programmed Arnout Vandecappelle – Essensium/Mind

How flash works Erasing Arnout Vandecappelle – Essensium/Mind

Erasing the floating gate: Reverse F-N tunnelling Complicated to do with MOS transistors -12V Arnout Vandecappelle – Essensium/Mind

Reverse the field by charging bulk Arnout Vandecappelle – Essensium/Mind

Erasing a block Bulk is entire block Select transistors can't be enabled They are floating Arnout Vandecappelle – Essensium/Mind

Combining cells in NAND String of 32 cells 2*16896 strings = 64 pages = 1 eraseblock Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

Bit flips Some cells don't reach VREF Some cells are not fully erased Worse for MLC Work-around: Error Correcting Codes (ECC) ECC can detect or correct N bitflips VT Arnout Vandecappelle – Essensium/Mind

Error Correcting Codes Hamming Correct 1 bit, detect 2 bit 2*n parity bits protect 2n data bits e.g. 3 ECC bytes protect 512 data bytes Bose, Ray-Chaudhuri, Hocquenghem (BCH) Correct M bits over 2n data bits with n*M parity bits E.g. BCH16: 27 ECC bytes protect 512 data bytes Low Density Parity Code Cfr. Hamming but more freedom of #parity bits Can use soft information (i.e. how close to VT) Not (yet) supported in Linux Arnout Vandecappelle – Essensium/Mind

Working with ECC Extra area in Flash to store ECC OOB = Out Of Band area When writing, also write ECC When reading, calculate ECC and compare Correction algorithm if calculated ECC is wrong syndrome = offset of the flipped bits Calculating ECC requires entire page Arnout Vandecappelle – Essensium/Mind

Hardware support for ECC SoCs have a hardware block to calculate ECC sometimes also calculate syndrome Limits the possibilities E.g. TI: BCH4, BCH8, BCH16 over 512 byte chunks Also limited to specific OOB locations ECC may be in the middle of the page Some NAND chips have built-in ECC Matches minimal required ECC Non-standard commands to read/write with ECC AFAIK not supported in Linux Arnout Vandecappelle – Essensium/Mind

Linux specifies ecc in devicetree nand-ecc-mode: none, soft, hw, hw_syndrome nand-ecc-algo: hamming or bch nand-ecc-strength: # corrected bits nand-ecc-step-size: # bytes per ECC chunk Not possible to specify per partition Annoying for first-stage bootloader which has fixed ECC Patch set from Boris Brezillon Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

Access limitations Eraseblocks → Erase full eraseblock before writing Write once ECC → Read and write full sub-pages (512 bytes) MLC → Write full pages → Write upper page then lower page Arnout Vandecappelle – Essensium/Mind

Flash file system takes care of access limitations jffs2, yaffs2, ubifs Only write to erased pages Collect writes until a page is filled Copy-on-write filesystem Journal to deal with power failure Arnout Vandecappelle – Essensium/Mind

Erased pages (= empty space) require special handling ECC(0xFF) != 0xFF Each page can be written only once → must distinguish erased page from 0xFF ECC of erased page will be wrong Software must detect this and return 0xFF page Flashing tools should not write all-0xFF pages Use ubiformat Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

Program/Erase cycles Some electrons captured in dielectric Don't escape easily also during erase Change VT 20V e- e- Arnout Vandecappelle – Essensium/Mind

Program/Erase cycles Error Patterns in MLC NAND Flash Memory: Measurement, Characterization, and Analysis Yu Cai, Erich F. Haratsch, Onur Mutlu and Ken Mai Arnout Vandecappelle – Essensium/Mind

Manage bad blocks When #errors is too high, mark block as bad Flash chip detects failed erase Flash chip detects write errors Detect when #corrected errors is high Torture eraseblock to confirm erase, check 0xff, write pattern, check pattern ⇒ Scrubbing Some blocks already marked bad in factory Arnout Vandecappelle – Essensium/Mind

Store bad blocks Two bytes in OOB of 1st page 0xFF 0xFF ⇒ OK anything else ⇒ BAD Consumes 2 OOB bytes → less space for ECC BCH4 / 512 bytes = 8 bytes → 64 bytes / 2KB Used by factory-marked bad blocks Bad block table at well-known flash location Must have enough spare, if BBT itself goes bad Must have 2 copies to deal with power failure Arnout Vandecappelle – Essensium/Mind

Limit Program/Erase cycles = Wear levelling Don't write to same location all the time Keep track of #erase Write to block with lowest #erase "write head" Migrate data when #erase is inbalanced 1 1000 1000 Arnout Vandecappelle – Essensium/Mind

Limit Program/Erase cycles = Wear levelling Don't write to same location all the time Keep track of #erase Write to block with lowest #erase "write head" Migrate data when #erase is inbalanced 2 1000 1000 Arnout Vandecappelle – Essensium/Mind

UBI layer manages wear leveling and bad blocks LEB0 LEB1 LEB2 LEB3 LEB4 LEB5 UBI volume MTD device PEB0 PEB1 PEB2 PEB3 PEB4 PEB5 PEB6 Header with erase counter, volume ID EC is written immediately after erase Migrate if EC difference is too high Several PEB may map same LEB, use latest Arnout Vandecappelle – Essensium/Mind

Bitflips in erased pages A cell may not have been fully erased ⇒ Erased block not entirely 0xFF Currently considered fatal by UBI ⇒ block is marked as bad IMHO too aggressive for high MLC 8-bit ECC can easily protect 1 bitflip Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

Electrons leak after some time Floating gate surrounded by insulator but this is not perfect e- Arnout Vandecappelle – Essensium/Mind

Electrons leak after some time 00 01 01 10 Error Patterns in MLC NAND Flash Memory Arnout Vandecappelle – Essensium/Mind

Retention is the limit of program/erase cycles retention errors Looks OK after writing but will fail after days/weeks Arnout Vandecappelle – Essensium/Mind

Retention strongly depends on temperature No quantitative results found Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

Read disturb Bypassed cells subject to strong field (6V) V V Bypassed cells subject to strong field (6V) Risk of floating gate being affected esp. in MLC → When reading, bits on other pages may flip V 6V 6V 6V 6V 6V V Arnout Vandecappelle – Essensium/Mind

Program disturb / interference Pages on same bitline Pages on same wordline Upper pages in same cell More important than read disturb but write only once 1→0 more likely 22 23 18 19 20 21 14 15 16 17 10 11 12 13 12 13 12 6 7 8 9 2 3 4 5 1 Arnout Vandecappelle – Essensium/Mind

How to deal with disturb Detect bitflips and mark blocks for refresh Make sure that all pages are regularly read Also good for retention (as long as device stays on) I'm not sure how to deal with program disturb Arnout Vandecappelle – Essensium/Mind

How flash fails to work Bit flips Access limitations Program/Erase cycles Retention Read/Program disturb Power failure Arnout Vandecappelle – Essensium/Mind

When power goes out... With buffered metadata E.g. new version is written, old one not erased yet Flash filesystem should take care of this UBIFS: sequence number on each node Arnout Vandecappelle – Essensium/Mind

When power goes out... In the middle of a write Target VREF not yet reached Some bits are 1 instead of 0 Bits just at VREF: extremely weak retention Can't be detected immediately Very vulnerable to read/program disturb Unstable bit problem REF1 REF2 REF3 11 10 01 00 Vth Arnout Vandecappelle – Essensium/Mind

When power goes out... In the middle of an erase Not all bits below lowest VREF Erased block not all 0xFF, but data not valid either Arnout Vandecappelle – Essensium/Mind

How to deal with unstable bits When attaching, find LEBs potentially written Read once and write back to fresh PEB IIUC this is not fully implemented Arnout Vandecappelle – Essensium/Mind

When the power goes out... In the middle of a write to a lower MLC page → Cell can be in any state Upper bit = 1 Program lower bit 1 → 0 Understanding the Impact of Power Loss on Flash Memory Hung-Wei Tseng, Laura M. Grupp, and Steven Swanson, DAC 2011 Arnout Vandecappelle – Essensium/Mind

When the power goes out... In the middle of a write to a lower MLC page → Cell can be in any state Don't use lower pages at all Only use lower pages when upper pages have CRC'ed data Arnout Vandecappelle – Essensium/Mind

Workarounds to make flash work Arnout Vandecappelle – Essensium/Mind

NAND driver Offer Erase, Write and Read primitives ECC handling Return -EUCLEAN for correctable error Return -EIO for uncorrectable error Return -EIO for failed write/erase Bad block handling BBT or in OOB Only store bad blocks, upper layer creates them Currently no primitive for empty space Arnout Vandecappelle – Essensium/Mind

UBI translation layer Wear levelling Choose less used PEBs for writing Migrate cold PEBs Across entire flash Do not partition flash Manage multiple volumes cfr. partitions Bad block creation Arnout Vandecappelle – Essensium/Mind

UBI translation layer future functionality Block refresh Background reading to deal with retention read/program disturb Paired page handling Distinguish safe and unsafe LEBs Use unsafe LEBs e.g. for migrated PEBs Arnout Vandecappelle – Essensium/Mind

UBIFS layer Copy-on-write of user data Copy-on-write of metadata: inodes, tree Collect writes in a write buffer → write complete pages Recover from power cuts Arnout Vandecappelle – Essensium/Mind

Managed flash Flash Translation Layer (FTL) SD card, SSD, eMMC, ... ECC handling Bad block handling and scrubbing Wear levelling Write once: block- and page remapping Usually not powercut safe Arnout Vandecappelle – Essensium/Mind

Problems with managed flash No help from filesystem structure Depending on history access can take 10-100x longer End of life (wear, retention) usually fatal FTL controller is unknown No specifications from manufacturer Hard to test: which access pattern is worst case? 2 "identical" devices not always same firmware Arnout Vandecappelle – Essensium/Mind

Optimising for managed flash Avoid small updates → write buffering ERASE/TRIM command for unused blocks f2fs (flash-friendly filesystem) Mostly optimise for access speed but this is also good for wear ext4 and btrfs take ideas Arnout Vandecappelle – Essensium/Mind

The future is in managed flash It's cheaper MLC hacks make workarounds more complex E.g. soft info for LDPC E.g. store some metadata in NOR or SLC Takes away CPU power Easier to give eMMC a dying gasp ⇒ IMHO everyone will move to eMMC Arnout Vandecappelle – Essensium/Mind

My advice Small capacity (<= 512MB) SLC NAND with dying gasp cap 1 big partition with UBI + several volumes Adapt ECC strength and EC imbalance to datasheet Large capacity (> 2GB) eMMC with dying gasp cap ext4 or btrfs or f2fs Arnout Vandecappelle – Essensium/Mind

Managed NAND Flash hides complexity SATA interface = SSD disk SD interface = eMMC But controllers are unpredictable Still need optimized access patterns Arnout Vandecappelle – Essensium/Mind

Flash storage technology Arnout Vandecappelle arnout@mind.be http://mind.be/content/Presentation_Flash-technology-ELCE16.odp © 2016 Essensium N.V. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 Unported License

Writing the floating gate: Hot carrier injection V V e- Arnout Vandecappelle – Essensium/Mind

Writing the floating gate: Hot carrier injection 12V 12V e- Arnout Vandecappelle – Essensium/Mind