• 검색 결과가 없습니다.

Overview of Flash Management SW

N/A
N/A
Protected

Academic year: 2022

Share "Overview of Flash Management SW"

Copied!
30
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

Overview of Flash Management SW

Jihong Kim

Dept. of CSE, SNU

(2)

Contents

• Flash Management Tasks

– Address Translation – Garbage Collection – Wear Leveling

• S/W Support for NAND Flash Memory

– Flash Translation Layers – Flash File Systems

– Memory Technology Device

(3)

Remind: NAND Flash Memory

• Pros

– Nonvolatile

– Fast random access

– Lower power consumption – Small size

– Shock resistance

• Cons

– Out-place Update

– A limited number of erase operations

(4)

Remind: Basic Operations

• Read

– Fast ( ~200 μs) – Page (2~8 KB)

• Write

– Slow ( ~800 μs) – Page (2~8 KB)

– Out-place update

• Erase

– Very slow (~2ms)

– Block (128~512 KB)

(5)

Flash Management Tasks

• Essential

– Address Translation

• Avoid in-place update

• Logical Block Address (LBA) -> Physical Block Address (PBA)

– Garbage Collection

• Reclaim invalid blocks -> Get new free blocks

• Optimization

– Wear Leveling

(6)

Out-place Update

A Valid page

Free page

Write(‘A’, Block 0, Page 0)

A

Block 0 Block 1

Overwrite X Page 0

Page 1 Page 2 Page 3

File Systems

(7)

Address Translation

A Valid page

Free page

Read (‘A’, Block 0, Page 0)

A

Block 0 Block 1

Page 0 Page 1 Page 2 Page 3

Address Translation Table

File Systems

(8)

Garbage Collection

NAND flash memory does not allow in-place update

• NAND flash memory will be full of invalid data…

A Valid page

Free page

Write(‘A’, Block 0, Page 0) X4

A

Block 0 Free Block

Overwrite X Page 0

Page 1 Page 2 Page 3

File Systems

A A

A Invalid page

(9)

Garbage Collection

Valid page Invalid page Free page

Block 0 Block 1

Page 0 Page 1 Page 2 Page 3

Block 2 Block 3

Gather valid data -> Erase invalid data

(10)

Limited Erase Cycles

• Remind

– Basic units of operations

• Erase: Block

• Read & Write: Page

– Erasure before write

– Flash memory block has a limitation (erasure cycle) on the number of erase operations (about 3K~10K in MLC)

– Blocks should be evenly erased to lengthen the overall lifetime of

flash memory

(11)

Spatial Locality of Write Request

HOT

HOT

(12)

Wearing of Flash Memory Blocks

COLD COLD COLD COLD

Valid page Invalid page Free page

HOT HOT

• Blocks with hot data are likely to be erased more

(13)

Wear Leveling

• Erase evenly all blocks

(14)

Side: Program Sequence Constraint

(15)

Cell-to-cell interference: a completed cell (whose LSB and MSB are both programmed) can be affected by program operations for

neighboring cells.

FPS: Fixed Program Sequence (Conventional)

11 01 00 10

: page program order

00

01 → 00

01 10

A B

C D

F H

E G I J

1 2 4 6 8

3 5 7 9 10

NAND Block

Fast LSB Slow MSB

Completed pages Max. 4 interferences

Interference

Interference

Interference

Completed

Interference

(16)

File Systems for H.D.D

File Systems (e.g., EXT3, NTFS, FAT32, …)

Allows in-place update

Does not need to garbage collection

Legacy file systems don’t understand NAND Management operations:

“what is garbage collection?”

“ what is address translation?”

(17)

S/W for NAND Flash Memory

• Flash Translation Layer

– Additional S/W layer for NAND flash memory

– Emulates conventional block devices (such as HDDs).

• Flash File Systems

– NAND flash-aware file system

– Replaces legacy file systems in a flash-friendly fashion.

• MTD Driver

– Provides a generic API for flash-based storage devices.

(18)

S/W Architecture

Applications

Flash File Systems File System (for H.D.D)

Block Device Driver (MTD)

Operating Systems

NAND Flash Memory

Flash Translation Layer

(19)

HOST

Flash Translation Layer

• A software layer to make NAND flash emulate traditional block devices (or disks)

File System Block device driver

FTL

NAND Flash

Flash I/F

Block I/F

(20)

Roles of FTL for NAND Flash Memory

• For performance

– Indirect mapping (address translation) – Garbage collection – Hot/cold separation – Interleaving over

multiple channels/flash chips/planes

– Request scheduling – Buffer management – …

▪ For Reliability

• Bad block management

• Wear-leveling

• Power-off recovery

• Error correction code (ECC)

• ...

▪ Other Features

• Encryption

• Compression

• Deduplication

• ...

(21)

Layout of FTL

Mapping Table

Garbage Collector FTL

Manager (Engine)

Wear Leveler

FTL Interface

Block Manager

Data

Separator

(22)

Logical Layout

(23)

Flash File Systems

• NAND flash memory-aware file systems

– Provides general file system operations

– Directly addressing the characteristics of flash memory

• Metadata have physical address of raw device

– Wear leveling

– Bad block management

– In general, flash file systems are based on Log-

structured File System

(24)

FTL & Flash File Systems

FTL Flash file system

Pros

Cons

Compatibility

Utilize Legacy File Systems

Exploits fully characteristics of NAND flash memory

Inefficiencies in flash memory

management Limited expandability

(25)

Device Drivers for Flash-based Storage

• MTD (Memory Technology Devices) overview

– Linux subsystem ( drivers/mtd/ )

– Provides uniform access to various flash devices – Provides a generic API for NAND-based storage

systems

– Provides an “MTD device” abstraction

(26)

MTD overview

NAND NOR DataFlash AG-AND OneNAND ECC’d NOR

MTD device, MTD API

JFFS2 character device (/dev/mtd0)

(27)

MTD device vs Block device

Block device

• Consists of sectors

• Sectors are small (512, 1024 bytes)

2 operations: read and write

• Bad sectors are hidden by hardware

• Sectors do not get worn out

MTD device

• Consists of eraseblocks

• Eraseblocks are larger (32-128 Kilobytes)

3 operations: read, write and erase

• Bad eraseblocks are not hidden

• Eraseblocks get worn-out after 10 4 -10 5

erasures.

(28)

Important Issues in Flash S/W

• Garbage Collection

– Triggering Condition

• If there are no free blocks

• Periodically

• When the number of free blocks is under a certain threshold

• When an I/O request does not happen

– Victim block Selection

– The number of reclaimed blocks

• One block at a time

• Until the number of free blocks exceeds a certain threshold

(29)

Important Issues in Flash S/W

• Mapping Scheme

– Page? Block? Hybrid?

• Wear Leveling

– Triggering Condition – Reducing Overhead

• Bad Block Management

• Reducing Memory Footprint

• Minimizing Computation Overhead

• Flash-Aware Data Structure Design

(30)

Reference

• Aayush Gupta et al., “DFTL: A flash translation layer employing

demand-based selective caching of page-level address mappings”, ASPLOS 2009

• Yang Hu et al., “Performance Impact and Interplay of SSD parallelis m through Advanced Commands, Allocation Strategy and Data Gr anularity”, International Conference on Supercomputing, 2011

• http://www.linux-mtd.infradead.org/

참조

관련 문서

à optimize block access time by organizing the blocks to correspond to how data optimize block access time by organizing the blocks to correspond to how data will be

In order to get the feature of pedestrian, a block-by-block histogram is created using the direction of the gradient based on HOG (Histogram of

- Mechanical-collimation-based Gamma CT system uses a mechanical collimator to record the unscattered gamma rays events, and to block the scattered events and other

Before a block of data in main memory is output to the database, all y p , log records pertaining to data in that block must have been output to stable storage. =>

geometry and stability using vector methods.. Dip direction, dip, strike and normal vector of a joint plane... of intersection vectors which satisfy all the inequalities

– The sequential log block for handling sequential writes causes frequent garbage collection.. • Cost of a garbage collection

– If the difference of erasure cycles (EC) between the oldest block in Hot Pool and the youngest block in Cold Pool is greater than a preset threshold.

• DRAM buffer is a lot faster than flash memory in write operation. Buffer Management Techniques (Jihong Kim/SNU) 15.. Architecture of Target System..