Download presentation
Presentation is loading. Please wait.
Published byJayson Dawson Modified over 9 years ago
1
File Systems in Real-Time Embedded Applications March 7th Eric Julien Choosing the Right Storage Media 1
2
Introduction Storage media provides a nonvolatile backing device for one or multiple partitions. Different media, different attributes: Removability, Latency, Sequential write/read throughput, Random write/read throughput, Cost, density, Reliability, wear, etc. 2
3
Latency in embedded systems Latency plays an often neglected role in FS performances on embedded systems. Limited memory availability in embedded system prevent writes or reads using large buffers. Global throughput becomes more affected by latency and less by I/O speed. 3
4
Latency: SD Card example 4 Bus speedRead lengthRd time (WC)ThroughputImprovement 25 MHz512 B1541 µs324.5 KB/s0 % 50 MHz512 B1520 µs328.9 KB/s1.4 % 25 MHz1024 B1582 µS632.1 KB/s94.8 % SanDisk 2GB MicroSD Card, SD 4 bit mode Access time: 1.5 ms (worst case). I/O time, 512B @ 25MHz: 40.96 µs. Total read time: 1541 µs (I/O 2.7% of total).
5
Storage Media Types RAM (volatile) Hard Disk Drive, Solid State Drive Unmanaged Flash Memory NOR Flash Memory NAND Flash Memory Managed Flash Memory Secure Digital (SD)/MultiMediaCard CompactFlash USB Mass Storage Device 5
6
RAM Volatile storage technology, unless battery- backed that has almost ideal performance characteristics. Very low latency, esp. static RAM, Fast write and read throughput. 6
7
Hard Disk Drive Stores data on rotating discs called platters coated with a magnetic material. Integrate a controller providing a sector based interface. Head movement imply seek time (latency): Slower random access time. Vulnerability to file system fragmentation. Average latency around 12ms (mobile drives). More RPM = less latency = more noise. 7
8
Hard Disk Drive Huge capacity up to a few TB. Very low cost per bit. Good sequential throughput – Typical modern 7200 RPM drive can sustain “disk-to- buffer” rates up to 130 MB/s (outer tracks). Reliability Controller provides ECC, bad sector management. Mechanical parts can cause data loss (eg. head crash): less suitable for mobile embedded systems. 8
9
Unmanaged Flash Memory Flash memory technology stores bits of information by modulating the charge on the floating-gate of field effect transistors. The presence of a charge on the floating gate affects the threshold required to activate the transistor, allowing its state to be read. 9
10
Unmanaged Flash Memory Types 10 Word line Bit line Source line NOR NAND Byte/word-addressable. More metal contacts: bigger cell size. Page-addressable. Less metal contacts: smaller cell size.
11
NOR Flash 11 Cells must be erased prior to programming. Byte/Word-addressable. Suitable for eXecute In Place (XIP). Cells are almost independent: Byte/Word program possible. Reads and programs don’t disturb neighboring cells. NORs generally don’t require ECC. Erases do affect multiple cells (page, sector, block).
12
NOR Flash 12 Single-byte/word random reads are fast and low- latency. No moving mechanical parts. Very good random and sequential read throughput. Slow programming and erase operations. Poor sequential and random write throughput. High cost per bit, medium density (bigger cells). Requires wear levelling: cell life 10 000 to 100 000 P/E cycles. No bad blocks.
13
NOR Flash: interface 13 Two types of interfaces: Parallel memory-mapped, using standard external bus interface. Best throughput/latency, XIP support, but uses more pins. Serially-interfaced devices (often SPI and variants). Common Flash memory Interface (CFI) standard. Provides info on queried device including: Size, block configuration, voltage, command set, etc. Eliminate need for descriptor tables. Allows new devices to be used without SW updates.
14
NAND Flash Cells must be erased prior to programming Page addressable. Not suitable for XIP (unless special controller). Cells aren’t independent: Smallest programmable unit: page. Smallest erasable unit: block (many pages). Reads and programs cause disturbance to other cells in a block. Data reliability affected; use of ECC mandatory. 14
15
NAND Flash Page random reads are fast and low-latency. Very good random and sequential read throughput. Fast programming and erase operation. – Good sequential and random write throughput. Low cost per bit, high density (smaller cells). Requires wear leveling: – Average cell life SLC: 100 000 to 1 000 000 P/E cycles. – Average cell life MLC: 10 000 to 100 000 P/E cycles. Bad blocks must be dealt with (incl. factory). 15
16
NAND Flash: interface Most common interface: parallel on IO bus. Less pins than parallel NOR. Some serial devices (often integrate ECC). Multiple plane, multiple die devices. Open NAND Flash Interface (ONFI) standard. Standard pinout for multiple packages. Standard command set. Parameter page for querying device parameters. Timing requirements, etc. 16
17
Unmanaged Flash Comparison 17 TypeNORNAND Addressable UnitByte/WordPage (512B, 2kB, 4kB) Sequential WriteVery SlowFast Single Byte WriteSlow Sequential ReadFastVery fast Single Byte ReadFastSlow eXecute In Place (XIP)YesNo DensityLowHigh Cost per BitHighLow Bad BlocksNoYes Avg. cell life (P/E c.)10 000-100 000SLC: 100 000-1 000 000 MLC: 10 000-100 000 Error Correction CodesNot requiredSLC: 1-8 bit/512 bytes MLC: 8+ bits/512 bytes
18
Managed Flash Memory NOR and NAND Flash memories, due to their erase before write nature, need to be handled differently than traditional devices. The algorithms involved are often complex and/or costly. Managed flash memory devices provide a simpler interface, taking care of logical block abstraction, wear leveling, EDC data protection, bad block management, etc. 18
19
Secure Digital/MultiMediaCard Secure Digital (SD) and MultiMediaCard are removable devices that contain a storage device (often NAND) along with a controller. Provides a standardized physical interface, socket and command set. Basic variants of SD and MMC have identical pinouts and almost identical command set. SD has a SPI compatible mode (MMC: opt.). 19
20
Secure Digital/MultiMediaCard 20 Card TypeMMCMMCplusSDmicroSDeMMC Form FactorStandard MicroIC Pins71398- RemovableYes No 1-bit bus modeYes 4-bit bus modeNoOpt. 8-bit bus modeNoOpt.No Opt. SPI modeOpt. Yes Opt. Max bus rate20 Mb/s416 Mb/s832 Mb/s 1600 Mb/s
21
Secure Digital 21 Maximum capacity is 2GB for SD cards, 32 GB for SDHC cards and 2TB for SDXC cards. SDA has recommended exFAT as FS for SDXC cards. Speed class: minimum sustained sequential read/write speed in MB/s with a card in a fragmented state (class 10: non-fragmented). Random read/write performance not controlled. Ultra High Speed (UHS): bus modes increasing max bus bandwidth (DDR, clk rate, 1.8V).
22
eMMC Managed flash memory in a non-removable package, compatible with MMCplus, convenient for integrated embedded system storage. Higher throughput bus modes, TRIM (background erase), Secure erase (purge), Sanitize (purge unmapped), Reliable writes, Boot areas… 22
23
Secure Digital/MultiMediaCard Performance of SD/MMC cards are highly dependent on embedded controller and storage device used. Sequential read/write throughput is usually good, but may be limited by max bus rate. Random read performance is usually middling, depending on controller latency. Random write performance is usually poor to mediocre, depending on controller. 23
24
USB Mass Storage Class Devices USB standard has a device class specifying a protocol for controlling a logical block addressed storage device through USB. Most common types: External HDD: similar performance to internal HDDs, but may be limited in throughput by bus. Flash memory (USB Flash drives): similar performance to SD/MMC cards, dependent on embedded controller and storage device. 24
25
Storage Media Comparison 25 TypeHard DiskNORNANDSD/MMC Addressable UnitLogical blockByte/WordPageLogical block Sequential Write Very GoodVery SlowGoodAvg-Good Random Write GoodSlowGoodAverage Sequential Read OutstandingGoodVery GoodGood Random Read PoorGood Average-Good Capacity HighLowAverage Cost per Bit Very LowHighLow Reliability FairGood Expected life 5-15 yrs 10k-100k P/E (SLC) 100k-1M P/E (SLC) 10k-100k P/E (MLC) Device dependent USB HDD: similar to Hard Disk, USB Flash Drive: similar to SD/MMC
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.