Database Information System Laboratory STAFF LSTAFF shparkdislab hufs
Database & Information System Laboratory STAFF와 LSTAFF의 비교 발표자 : 박 성 환 (shpark@dislab. hufs. ac. kr)
Database & Information System Laboratory STAFF
STAFF • State Transition Applied Fast Flash Translation Layer - Flash Memory System의 Software 구조 - • 목표 – 적은 양의 Memory를 사용하여 실제 Embedded System에 적용 DISLab Made By Hackereyes 3
Block States • F state (Free) – Erase 후 Write가 한번도 되지 않은 상태 • O state (Old) – Block내의 존재하는 Data들은 더 이상 유효하지 않음 • M state – In-place로 Data가 기록되고 있는 Block • S state – M state Block중 Block이 가득 찬 Block – 교체 합병 연산에 의해 O state로 전이 됨 • N state – Out-of-place로 Data가 기록되고 있는 Block DISLab Made By Hackereyes 4
Block States Transition DISLab Made By Hackereyes 5
Write Operation Flow Chart Write OP Merging operation is needed Yes [Branch] Do merging operation No The logical block corresponding to the lsn has an M or N state block Yes Write the input data to the M or N state block Yes Get an F state block The F state block is converted to the M state block Corresponding sector is empty No The block is converted to the N state block No Write the input data to the M state block The block is the M state block No Write the input data to the N state block End OP DISLab Made By Hackereyes 6
Merging Operation • Swap merging – M state block에 Data를 추가적으로 Write하려 할 때 발생 • Smart merging – 더 이상 빈 공간이 없는 N state Block에 Write하려 할 때 발생 DISLab Made By Hackereyes 7
Transition to O States Block • STAFF Algorithm은 Logical Block 하나에 최대 2개의 Physical Block이 할당 됨 • 때문에 2개의 Physical Block에 더 이상 공간이 없을 시 O state Block으로 전이 됨 DISLab Made By Hackereyes 8
Read Operation Flow Chart Read OP The logical block corresponding to the lsn has an M or N state block No The logical block has an S state block Yes No Yes [The block is the N state block] No The block is the M state block Print : “The logical sector has not been written” No Read from the M state block Yes The corresponding sector is set No The logical block has an S state block No Yes Read from the S state block End OP DISLab Made By Hackereyes 9
Read Operation Flow Chart [The block is the N state block] The sector exist in the N state block Yes Read from the N state block No The logical block has an S state block Yes Read from the S state block No Print : “The logical sector has not been written” End OP DISLab Made By Hackereyes 10
Read Operation • 읽혀질 Data는 M, N or S Block에 존재 • 읽혀질 Data가 두 개의 Physical Block에 존재 시 – M or N 의 Data가 최신 Data임 DISLab Made By Hackereyes 11
Database & Information System Laboratory LSTAFF
Definition 1. Sector 1. File System에서 Read/Write 연산을 수행하는 최소 단위 2. Page 1. Flash Device에서 Read/Write 연산을 수행하는 최소 단위 3. Block 1. Flash Device에서 Erase 연산을 수행하는 단위가 됨 (Erase Unit) 2. 여러 개의 Page로 구성됨 ( 1 Block = 64 Page ) 4. 같은 Sector/Page에 Rewrite를 하려면 해당 Block을 먼저 Erase해 야함 DISLab Made By Hackereyes 13
Large STAFF • Mapping – Small Block에서는 Sector/Block 단위의 Mapping만 고려 – Large Block에서는 Sector/Page/Block 단위의 Mapping을 고려 • 약자 논문에서의 의미 분석한 의미 lsn Logical Sector Number lbn Logical Block Number lpn Logical Page Number Logical Page Offset in a Block lso Logical Sector Offset in a Page np Number of Pages in a Block ns Number of Sectors in a Page DISLab Made By Hackereyes 14
Large STAFF • 계산 논문에서의 계산 분석한 계산 lbn = lsn / np lbn = lsn / (np*ns) tmp = lsn % np tmp = lsn % (np*ns) lpn = tmp / ns lso = tmp %ns lso = tmp % ns lbn • 논문에서의 예 – lsn = 101 , lbn = 1 , lpn = 9 , lso = 1 • 분석한 예 – lsn = 101 , lbn = 0 , lpn = 25 , lso = 1 DISLab Made By Hackereyes 15
실험 환경 • 약 128 MB크기의 Flash Device – 1024 blocks/device , 64 pages/block , 4 sectors/page – 1 page당 1 Spare Area가 존재 • 64 Bytes • 단위 – 1 Page = 4 Sectors – 1 Block = 64 Pages • 크기 – 1 Page = 약 2 KB – 1 Block = 약 131 KB – 1024 Block = 약 134 MB DISLab Made By Hackereyes 16
LSTAFF에서 제안하는 Page Format • 세 단계로 Mapping 정보를 저장함 – Sector , Page , Block • lsn과 lpn은 Page당 저장 되며, lbn과 Block State는 Block당 저장 됨 • F , S , O , M State Blocks는 lsn이나 lpn이 필요 없음 – N State Block은 out-of-place로 기록되기에 lsn이나 lpn을 사용함 DISLab Made By Hackereyes 17
N State Block의 Mapping Options 1. Page Mapping 1. Logical page number Physical page number Mapping 2. lsn은 Flash Memory에 기록하지 않아도 됨 2. Sector Mapping 1. Logical sector number Physical sector number Mapping 2. lpn은 Flash Memory에 기록하지 않아도 됨 3. 1: N Mapping 1. 하나의 Logical page/sector가 하나 이상의 Physical page/sector와 Mapping 됨 DISLab Made By Hackereyes 18
Page Mapping vs Sector Mapping • ex) lsn Sequence : 0, 1, 2, 3, 8, 9, 9 DISLab Made By Hackereyes 19
Evaluation • LSTAFF는 STAFF와 성능 평가식이 동일 함 • LSTAFF는 STAFF에 비해 동시에 다수의 Sector를 Read/Write 할 수 있기 때문에 전반적으로 성능이 좋았음 DISLab Made By Hackereyes 20
- Slides: 20