Flash Memory      David Woodhouse                  david@woodhou.se                    Kernel Recipes                  Sep...
Overview• What is flash?• What makes flash “special”?• How to use flash effectively... and safely• Flash Translation Layer...
The flash cell                                           Diagram © Wikipedia user Cyferz                                  ...
NOR flash                                             Diagram © Wikipedia user Cyferz                                     ...
NAND flash                                         Diagram © Wikipedia user Cyferz                                        ...
NAND flash: one string                                            I/O              Software and Services Group         6  ...
NAND flash: one eraseblock                    Page                                                                     I/O...
Data loss on flash• Charge loss over time• Charge builds up in insulator• Write disturb• Read disturb                     ...
Programming NAND flash       Other    Programmed           Other       Page        Page              Page       +10V      ...
Write disturb       Other   Programmed              Other       Page       Page                 Page       +10V       +20V...
Read disturb     Other     Read                 Other     Page      Page                 Page     +5V        0V           ...
Single Level CellVoltage               Distribution of 0-level cells             Vt – threshold voltage               Dist...
Multi Level CellVoltage                Distribution of (0,0) cells                Distribution of (1,0) cells             ...
NAND electrical interface                                     CE RE WEAddress Latch Enable (ALE)Command Latch Enable (CLE)...
Coping with flash• Error correction (ECC)• Bad block management• Programming pages sequentially• Garbage collection• Wear ...
Flash Translation Layers12345678                   Software and Services Group   16                                       ...
Flash Translation Layers1             12             23             34             45     chain   56             67       ...
Flash Translation Layers1             1                  12             2                  23             3               ...
Flash Translation Layers1             1                  12             2                  23             3               ...
Flash Translation Layers            1                  1            2                  2            3                  3  ...
Flash Translation Layers                               1                               2                               3  ...
TRIM1           1                   12           2                   23           3                   34           4      ...
TRIM1           1                   12           2                   23           3                   34           4      ...
TRIM1             1                   12             2                   23             3                   34            ...
TRIM            1                   1            2                   2            3                   3            4      ...
TRIM                                1                                2                                3                   ...
An alternative Flash Translation Layer               Sect #1               Sect #2                         Software and Se...
An alternative Flash Translation Layer               Sect #1               Sect #2               Sect #1               Sec...
An alternative Flash Translation Layer               Sect #1               Sect #2               Sect #1               Sec...
File system on top of file system• Efficiency   – Hard to optimise for opaque lower file system   – Missed garbage collect...
MTD support in Linux• Synchronous read/write• Asynchronous erase• ECC for NAND• Bad Block management                      ...
UBI  http://www.linux-mtd.infradead.org/doc/ubidesign/ubidesign.pdf• Static volumes   – Atomically overwritable   – Wear l...
Ideal hardware wish list• Fast queued DMA transfers• Full error correction in hardware   – With reporting of corrected err...
Questions?       Software and Services Group   34                                     34
Upcoming SlideShare
Loading in...5
×

Flash memory

1,374

Published on

Flash memory — how it works, and how we use it from Linux, SSDs and ‘real’ flash file systems

Published in: Technology, Business
1 Comment
2 Likes
Statistics
Notes
  • sir please sen this ppt to mail id is hrsunil1234@gmail.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
1,374
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Flash memory

  1. 1. Flash Memory David Woodhouse david@woodhou.se Kernel Recipes September 2012Software and Services Group
  2. 2. Overview• What is flash?• What makes flash “special”?• How to use flash effectively... and safely• Flash Translation Layers• Other approaches• Linux support for flash Software and Services Group 2 2
  3. 3. The flash cell Diagram © Wikipedia user Cyferz CC BY-SA 3.0Source Bit Line Line Word Line Control Gate Floating Gate N P N Software and Services Group 3 3
  4. 4. NOR flash Diagram © Wikipedia user Cyferz CC BY-SA 3.0 Bit LineN N, GND N N, GND N N, GND N P Software and Services Group 4 4
  5. 5. NAND flash Diagram © Wikipedia user Cyferz CC BY-SA 3.0 Bit LineN N N N N N N N N N N P Software and Services Group 5 5
  6. 6. NAND flash: one string I/O Software and Services Group 6 6
  7. 7. NAND flash: one eraseblock Page I/O I/O16896 bits per page I/O(2048 bytes + 64 bytes) I/O 64 pages per eraseblock Software and Services Group 7 7
  8. 8. Data loss on flash• Charge loss over time• Charge builds up in insulator• Write disturb• Read disturb Software and Services Group 8 8
  9. 9. Programming NAND flash Other Programmed Other Page Page Page +10V +20V +10V+10V I/O 0V I/O+10V I/O 0V I/O Programmed cells Software and Services Group 9 9
  10. 10. Write disturb Other Programmed Other Page Page Page +10V +20V +10V+10V I/O 0V I/O+10V I/O 0V I/O Disturbed cells Software and Services Group 10 10
  11. 11. Read disturb Other Read Other Page Page Page +5V 0V +5V0V I/O0V I/O0V I/O0V I/O Disturbed cells Software and Services Group 11 11
  12. 12. Single Level CellVoltage Distribution of 0-level cells Vt – threshold voltage Distribution of 1-level cells Software and Services Group 12 12
  13. 13. Multi Level CellVoltage Distribution of (0,0) cells Distribution of (1,0) cells Distribution of (0,1) cells Distribution of (1,1) cells Software and Services Group 13 13
  14. 14. NAND electrical interface CE RE WEAddress Latch Enable (ALE)Command Latch Enable (CLE) NAND Ready/Busy (R/B) chip D0-7 Software and Services Group 14 14
  15. 15. Coping with flash• Error correction (ECC)• Bad block management• Programming pages sequentially• Garbage collection• Wear levelling• Paired pages? Software and Services Group 15 15
  16. 16. Flash Translation Layers12345678 Software and Services Group 16 16
  17. 17. Flash Translation Layers1 12 23 34 45 chain 56 67 78 8 Write sectors 1-4 Software and Services Group 17 17
  18. 18. Flash Translation Layers1 1 12 2 23 3 34 4 45 chain 5 chain 56 6 67 7 78 8 8 Write sectors 2, 4, 6 Software and Services Group 18 18
  19. 19. Flash Translation Layers1 1 12 2 23 3 34 4 45 chain 5 chain 56 6 67 7 78 8 8“Fold” chain into its final block Software and Services Group 19 19
  20. 20. Flash Translation Layers 1 1 2 2 3 3 4 4 5 chain 5 6 6 7 7 8 8Erase previous blocks in chain Software and Services Group 20 20
  21. 21. Flash Translation Layers 1 2 3 4 5 6 7 8Erase previous blocks in chain Software and Services Group 21 21
  22. 22. TRIM1 1 12 2 23 3 34 4 45 chain 5 chain 56 6 67 7 78 8 8 Software and Services Group 22 22
  23. 23. TRIM1 1 12 2 23 3 34 4 45 chain 5 chain 56 6 67 7 78 8 8 TRIM sectors 1, 3 Software and Services Group 23 23
  24. 24. TRIM1 1 12 2 23 3 34 4 45 chain 5 chain 56 6 67 7 78 8 8“Fold” chain into its final block Software and Services Group 24 24
  25. 25. TRIM 1 1 2 2 3 3 4 4 5 chain 5 6 6 7 7 8 8Erase previous blocks in chain Software and Services Group 25 25
  26. 26. TRIM 1 2 3 4 5 6 7 8Erase previous blocks in chain Software and Services Group 26 26
  27. 27. An alternative Flash Translation Layer Sect #1 Sect #2 Software and Services Group 27 27
  28. 28. An alternative Flash Translation Layer Sect #1 Sect #2 Sect #1 Sect #2 Sect #3 Sect #4 Software and Services Group 28 28
  29. 29. An alternative Flash Translation Layer Sect #1 Sect #2 Sect #1 Sect #2 Sect #3 Sect #4 Sect #2 Sect #4 Sect #6 Software and Services Group 29 29
  30. 30. File system on top of file system• Efficiency – Hard to optimise for opaque lower file system – Missed garbage collection opportunity – Real file system knows more about data longevity – Real file system knows about transactions• Reliability – Closed source file system implementation – No access to underlying medium for fsck / recovery – Often just implemented badly Software and Services Group 30 30
  31. 31. MTD support in Linux• Synchronous read/write• Asynchronous erase• ECC for NAND• Bad Block management Software and Services Group 31 31
  32. 32. UBI http://www.linux-mtd.infradead.org/doc/ubidesign/ubidesign.pdf• Static volumes – Atomically overwritable – Wear levelled – CRC protected• Dynamic volumes – Writable flash – Simple logical <-> physical mapping – Deferred erase (unmap) – Scrubbing Software and Services Group 32 32
  33. 33. Ideal hardware wish list• Fast queued DMA transfers• Full error correction in hardware – With reporting of corrected errors – Scrubbing• Page copy Software and Services Group 33 33
  34. 34. Questions? Software and Services Group 34 34

×