project 1 log block ftl - androbenchcsl.skku.edu/uploads/ice3028s14/lab6-project1.pdf · ice3028:...
TRANSCRIPT
![Page 1: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/1.jpg)
Sejun Kwon([email protected])
Computer Systems Laboratory
Sungkyunkwan University
http://csl.skku.edu
Project 1 Log Block FTL
![Page 2: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/2.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 2
Contents
▪ Schedule
▪ Log block FTL
▪ ftl_test
![Page 3: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/3.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 3
Schedule
Date Title
4/29 (Mon) Project #1 Q&A
5/12 (Mon) Project #2 Project 2
5/26 (Mon) Project #2 Progress Report
6/9 (Mon) Project #2 Presentation
![Page 4: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/4.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 4
Log Block FTL
▪ Block mapping for read. (data block)
▪ Page mapping for write.(log block)
![Page 5: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/5.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 5
Log Block FTL
LBN
0
1
2
0
1
2
3
4
5
6
7
8
9
10
11
3
9
11
LPN
0
1
2
3
LPN
0
1
2
3
![Page 6: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/6.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 6
Switch/Partial Merge
LBN
0
1
2
0
1
2
3
4
5
6
7
8
9
10
11
0
1
2
9
11
LPN
0
1
2
3
LPN
0
1
2
3
Valid data copy
![Page 7: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/7.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 7
Full Merge
LBN
0
1
2
0
1
2
3
4
5
6
7
8
9
10
11
0
3
0
9
11
LPN
0
1
2
3
LPN
0
1
2
3
New block
0
1
2
3
![Page 8: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/8.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 8
Limitation
▪ Exploit the number of log block
• (ex : #define NUM_LOGBLK 3)
▪ Modify only ftl.c and ftl.h
▪ Do not write or erase your data in Block #0
▪ You can use spare area.
• (VBLKS_PER_BANK~SPARE_VBLKS_PER_BANK-1) (jasmine.h)
▪ If host tries to read data not programmed, it should read zeros.
![Page 9: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/9.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 9
Limitation
▪ Due date : 5/8 23:59:59 (Thu)
▪ You can use the source code in openssd ftl, but do not copy.
▪ Implement ftl_open, ftl_read, ftl_write, ftl_isr, ftl_flush
![Page 10: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/10.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 10
Limitation
▪ mailto : [email protected]
▪ you should follow this form in the subject when you submit.
▪ [ICE3028]학번,이름
▪ you would lose 20% per one day late
![Page 11: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/11.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 11
Bonus Point
▪ Power off Recovery
• You can implement in ftl_flush()
▪ Run-time Bad Block Process
• You can implement in ftl_isr()
![Page 12: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/12.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 12
Advice for implementation
▪ Read
• Need to know whether data to read is in data block or log block
• Need to know what log block is mapping to certain data block.(Data block to Log block mapping)
![Page 13: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/13.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 13
Advice for implementation
▪ Write
• Similar to page mapping per log block.
• Mechanism for allocating new block
- (free list, bitmap)
• Many metadata should be managed by each log block, and each bank.
![Page 14: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/14.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 14
Advice for implementation▪ Garbage Collection• Switch merge is special case of partial merge.
• There are two cases when G.C occurs.- Pages in a log block are sold out/ No avail log block
- You can select a block as victim block when it has minimum valid copy of log blocks.(No avail log block)
• Need to know what data block is mapping to certain log block.(Log block to Data block mapping)
• Need to know valid pages of certain log block.
![Page 15: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/15.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 15
Advice for implementation▪ ftl_open
• Read the metadata from NAND flash
• Erase all blocks
• Initialize variable
▪ ftl_isr
• Switch new block for writes or erase.
▪ ftl_flush
• Flush metadata to Nand.
![Page 16: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/16.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 16
Advice for implementation
▪ ETC
• Step by Step
- Ex) Writes for one block -> Switch Merge -> G.C
• Do not Copy!!!
![Page 17: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/17.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 17
uart_print()
▪ include/jasmine.h
▪ #define OPTION_UART_DEBUG 1
▪ uart_printf(“Total FTL DRAM %d Kb”,dram_size);
![Page 19: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/19.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 19
ftl_test
▪ Download Openssd_1.1.1
▪ Add ftl_test.c to ftl_xxx folder
▪ Add ftl_test.c to Makefile
▪ Modify jasmine.h
![Page 21: Project 1 Log Block FTL - AndroBenchcsl.skku.edu/uploads/ICE3028S14/lab6-project1.pdf · ICE3028: Embedded Systems Design (Spring 2014) –Jin-Soo Kim (jinsookim@skku.edu) 8 Limitation](https://reader036.vdocuments.site/reader036/viewer/2022070922/5fba5de9dc7dc37bf9432320/html5/thumbnails/21.jpg)
ICE3028: Embedded Systems Design (Spring 2014) – Jin-Soo Kim ([email protected]) 21
ftl_test
▪ ftl.h
• #define FTL_TEST_ADDR (XXX_BUF_ADDR + XXX_BUF_BYTES)
• #define FTL_TEST_BYTES (4 * 1024 * 1024) // 4MB