20
An Efficient B-Tree Layer for Flash-Memory Storage Systems Chin-Hsien Wu, Li-Pin Chang, and Tei-Wei Kuo The 9th International Conference on Real -Time Computing Systems and Applications (RTCSA 2003), Tainan, Taiwan 2003 발발발 : 발발발

An Efficient B-Tree Layer for Flash-Memory Storage Systems

Embed Size (px)

Citation preview

Page 1: An Efficient B-Tree Layer for Flash-Memory Storage Systems

An Efficient B-Tree Layer for Flash-Memory Storage Systems

Chin-Hsien Wu, Li-Pin Chang, and Tei-Wei KuoThe 9th International Conference on Real-Time Computing Systems and Applications (RTCSA 2003), Tainan, Ta

iwan 2003

발표자 : 안성용

Page 2: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Introduction

Flash Memory considered as an alternative to replace hard disk

B-tree one of the most popular index structures because of its

scalability and efficiently

Objective We propose a module over a traditional FTL to handle

intensive byte-wise operations due to B-tree access BFTL (efficient B-Tree layer for flash-memory storage

systems)

Page 3: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Background

Flash Memory native file-system approach

directly manage raw flash memory JFFS/JFFS2, LFM, YAFFS

block-device emulation approach provide a transparent block-device emulation FTL/FTL-Lite

Page 4: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Background

Flash Memory (Con’t) out-place update

could not be over-written unless it is erase first

garbage collection to recycle dead pag

es scattered over blocks

were-leveling each block could be

erased for 1 million(106) times

Page 5: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Background

B-tree tree 에 있는 각 Node 는

최대 m 개 , 최소 (m/2)개의 종속 tree 를 가져야 한다

모든 leaf Node 는 같은 level 에 있어야 한다

Node 의 key 값의 개수는 종속 Tree 의 개수보다 하나 적으며 최소 (m/2)-1 개 , 최대 m-1개이다 .

internal node: ordered list of key and linkage point

leaf node: key value and record pointer

Page 6: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Problem Definition

On hard disk we usually set the size of a B-Tree node as the size which

can be efficiently handled by the used block device. To insert, delete, and re-balance B-Trees, B-Tree nodes

are fetched from the hard disk and then written back to the original location.

Such operations are very efficient for hard disks.

On Flash Memory Updating (or writing) data over flash memory is a very

complicated and expensive operation. Since out-place update is adopted, a whole page (512B)

which contains the new version of data will be written to flash memory

Page 7: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

Overview BFTL sits between the application layer and the block-

device emulated by FTL

Page 8: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

reservation buffer temporarily hold the newly generated records (dirty records) record deletions are handled by adding “invalidation records” to t

he reservation buffer. the dirty records should be timely flushed to flash memory

index units When dirty records are flushed, BFTL constructed “index units” fo

r each dirty record reflect modification of the corresponding B-Tree node data_ptr, parent_node, primary_key, left_ptr, right_ptr, identifier,

op_flag Many index units are packed into few sectors to reduce the num

ber of pages physically written. index units of one B-Tree node could now exist in different sector

s.

Page 9: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

index units (Con’t) B-Tree node could be logically constructed by collecting and par

sing all relevant index units A node translation table is adopted to handle the collection of in

dex units.

Page 10: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

The node Translation Table

maps a B-Tree node to a collection of LBA’s where the related index units reside.

could be re-built by scanning the flash memory when system is powered-up

Page 11: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

The node Translation Table system parameter C

number of items in a list cause low performance and space overhead

control the maximum length of the lists of the node translation table

When the length of a list grows beyond C, the list will be compacted.

To compact a list, all related index units are collected into RAM and

then written back to flash memory with a smallest number of sectors.

Page 12: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

Page 13: An Efficient B-Tree Layer for Flash-Memory Storage Systems

The Design and Implementation of BFTL

The Commit Policy how to smartly pack index units into few sectors

many index units should be packed together in order to further reduce the number of sectors needed

we also hope that index units of the same B-Tree node will not be scattered over many sectors

The packing problem of index units into sectors is NP-Hard. The intractability of the problem could be shown by

a reduction from the Bin-Packing problem

Page 14: An Efficient B-Tree Layer for Flash-Memory Storage Systems

System Analysis

Suppose n records are to be inserted. let a B-Tree node fit in a sector (provided by FTL). Let H denote the current height of the B-Tree Nsplit denote the number of nodes which are split during

the handling of the insertions. C: maximum length of the lists

number of sectors read

number of sectors read

Page 15: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Performance Evaluation

Experiment Setup 4MB NAND flash memory greedy block-recycling policy fanout of B-tree: 21 size of a B-Tree node fits in a sector. reservation buffer size: 60 records maximum length of the list: 3 a small amount of B-Tree nodes in the top levels were cached i

n RAM ratio rs: control the value distribution of the inserted keys

Page 16: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Performance Evaluation

Performance of B-Tree Index Structures Creation insert 24000 records

Page 17: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Performance Evaluation

Performance of B-Tree Index Structures Creation (Con’t)

Page 18: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Performance Evaluation

Performance of B-Tree Index Structures Maintenance 24000 operation we varied the ratio of the number of deletions to the number of

insertions. (50/50, 40/60, 30/70, 20/80,10/90)

Page 19: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Performance Evaluation

Size of the reservation buffer

Energy Consumption

Page 20: An Efficient B-Tree Layer for Flash-Memory Storage Systems

Conclusion

Conclusion Flash-memory storage systems are very suitable for

embedded systems we propose a methodology and a layer design to

support B-Tree index structures over flash memory. BFTL reduces the number of redundant data written to

flash memory.

Future Work How to manage data records and their index structures

over huge flash memory