SlideShare a Scribd company logo
1 of 34
Flash Memory
      David Woodhouse
                  david@woodhou.se




                    Kernel Recipes
                  September 2012


Software and Services Group
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
The flash cell
                                           Diagram © Wikipedia user 'Cyferz'
                                                             CC BY-SA 3.0




Source                          Bit
 Line                          Line



            Word Line
           Control Gate

           Floating Gate


   N            P             N




                           Software and Services Group                    3
                                                                          3
NOR flash
                                             Diagram © Wikipedia user 'Cyferz'
                                                               CC BY-SA 3.0




                                                                Bit Line




N   N, GND   N      N, GND       N         N, GND           N
                      P




                             Software and Services Group                    4
                                                                            4
NAND flash
                                         Diagram © Wikipedia user 'Cyferz'
                                                           CC BY-SA 3.0


                                                          Bit Line




N   N   N   N    N   N    N       N        N         N         N
                     P




                         Software and Services Group                    5
                                                                        5
NAND flash: one string




                                            I/O




              Software and Services Group         6
                                                  6
NAND flash: one eraseblock

                    Page




                                                                     I/O


                                                                     I/O
16896 bits
 per page
                                                                     I/O
(2048 bytes
 + 64 bytes)


                                                                     I/O


                       64 pages per eraseblock

                                       Software and Services Group         7
                                                                           7
Data loss on flash




• Charge loss over time
• Charge builds up in insulator
• Write disturb
• Read disturb




                                  Software and Services Group   8
                                                                8
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
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
Read disturb
     Other     Read                 Other
     Page      Page                 Page
     +5V        0V                  +5V



0V                                                        I/O


0V                                                        I/O


0V                                                        I/O




0V                                                        I/O


              Disturbed cells

                            Software and Services Group         11
                                                                11
Single Level Cell

Voltage


               Distribution of 0-level cells

             Vt – threshold voltage


               Distribution of 1-level cells




                     Software and Services Group   12
                                                   12
Multi Level Cell

Voltage

                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
NAND electrical interface


                                     CE RE WE


Address Latch Enable (ALE)
Command Latch Enable (CLE)
                                           NAND
         Ready/Busy (R/B)                   chip


                 D0-7



                             Software and Services Group   14
                                                           14
Coping with flash


• Error correction (ECC)
• Bad block management
• Programming pages sequentially
• Garbage collection
• Wear levelling
• Paired pages?




                               Software and Services Group   15
                                                             15
Flash Translation Layers


1
2
3
4
5
6
7
8




                   Software and Services Group   16
                                                 16
Flash Translation Layers


1             1
2             2
3             3
4             4
5     chain   5
6             6
7             7
8             8



         Write sectors 1-4

                    Software and Services Group   17
                                                  17
Flash Translation Layers


1             1                  1
2             2                  2
3             3                  3
4             4                  4
5     chain   5    chain         5
6             6                  6
7             7                  7
8             8                  8



      Write sectors 2, 4, 6

                    Software and Services Group   18
                                                  18
Flash Translation Layers


1             1                  1
2             2                  2
3             3                  3
4             4                  4
5     chain   5    chain         5
6             6                  6
7             7                  7
8             8                  8



“Fold” chain into its final block

                    Software and Services Group   19
                                                  19
Flash Translation Layers


            1                  1
            2                  2
            3                  3
            4                  4
            5    chain         5
            6                  6
            7                  7
            8                  8



Erase previous blocks in chain

                  Software and Services Group   20
                                                20
Flash Translation Layers


                               1
                               2
                               3
                               4
                               5
                               6
                               7
                               8



Erase previous blocks in chain

                  Software and Services Group   21
                                                21
TRIM


1           1                   1
2           2                   2
3           3                   3
4           4                   4
5   chain   5   chain           5
6           6                   6
7           7                   7
8           8                   8




                   Software and Services Group   22
                                                 22
TRIM


1           1                   1
2           2                   2
3           3                   3
4           4                   4
5   chain   5   chain           5
6           6                   6
7           7                   7
8           8                   8



     TRIM sectors 1, 3

                   Software and Services Group   23
                                                 23
TRIM


1             1                   1
2             2                   2
3             3                   3
4             4                   4
5    chain    5    chain          5
6             6                   6
7             7                   7
8             8                   8



“Fold” chain into its final block

                     Software and Services Group   24
                                                   24
TRIM


            1                   1
            2                   2
            3                   3
            4                   4
            5    chain          5
            6                   6
            7                   7
            8                   8



Erase previous blocks in chain

                   Software and Services Group   25
                                                 25
TRIM


                                1
                                2
                                3
                                4
                                5
                                6
                                7
                                8



Erase previous blocks in chain

                   Software and Services Group   26
                                                 26
An alternative Flash Translation Layer


               Sect #1
               Sect #2




                         Software and Services Group   27
                                                       27
An alternative Flash Translation Layer


               Sect #1
               Sect #2
               Sect #1
               Sect #2
               Sect #3
               Sect #4




                         Software and Services Group   28
                                                       28
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
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
MTD support in Linux



• Synchronous read/write
• Asynchronous erase
• ECC for NAND
• Bad Block management




                           Software and Services Group   31
                                                         31
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
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
Questions?




       Software and Services Group   34
                                     34

More Related Content

What's hot

Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
SambitShreeman
 
8279 in microprocessor
8279 in microprocessor8279 in microprocessor
8279 in microprocessor
Aisu
 
Reliability and yield
Reliability and yield Reliability and yield
Reliability and yield
rohitladdu
 
Controller area network -ppt
Controller area network -pptController area network -ppt
Controller area network -ppt
velichetiphani
 
Vlsi design and fabrication ppt
Vlsi design and fabrication  pptVlsi design and fabrication  ppt
Vlsi design and fabrication ppt
Manjushree Mashal
 

What's hot (20)

Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
 
DDR
DDRDDR
DDR
 
chapter-12memory.pptx
chapter-12memory.pptxchapter-12memory.pptx
chapter-12memory.pptx
 
VLSI Design(Fabrication)
VLSI Design(Fabrication)VLSI Design(Fabrication)
VLSI Design(Fabrication)
 
Cmos fabrication
Cmos fabricationCmos fabrication
Cmos fabrication
 
8279 in microprocessor
8279 in microprocessor8279 in microprocessor
8279 in microprocessor
 
Polyteda: Power DRC/LVS, October 2016
Polyteda: Power DRC/LVS, October 2016Polyteda: Power DRC/LVS, October 2016
Polyteda: Power DRC/LVS, October 2016
 
Microprocessor Presentation
Microprocessor PresentationMicroprocessor Presentation
Microprocessor Presentation
 
Surface mount technology (smt) and smd packages
Surface mount technology (smt) and smd packagesSurface mount technology (smt) and smd packages
Surface mount technology (smt) and smd packages
 
Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)
 
CMOS
CMOS CMOS
CMOS
 
PCB Layout Fundamentals
PCB Layout FundamentalsPCB Layout Fundamentals
PCB Layout Fundamentals
 
Semiconductor memory
Semiconductor memorySemiconductor memory
Semiconductor memory
 
SOI Applications -- an overview and some examples
SOI Applications -- an overview and some examplesSOI Applications -- an overview and some examples
SOI Applications -- an overview and some examples
 
Basics Of Semiconductor Memories
Basics Of Semiconductor MemoriesBasics Of Semiconductor Memories
Basics Of Semiconductor Memories
 
Pin diagram 8085
Pin diagram 8085 Pin diagram 8085
Pin diagram 8085
 
Reliability and yield
Reliability and yield Reliability and yield
Reliability and yield
 
Controller area network -ppt
Controller area network -pptController area network -ppt
Controller area network -ppt
 
Vlsi design and fabrication ppt
Vlsi design and fabrication  pptVlsi design and fabrication  ppt
Vlsi design and fabrication ppt
 
bus Can
bus Canbus Can
bus Can
 

Similar to Flash memory

Virtual Network Performance Challenge
Virtual Network Performance ChallengeVirtual Network Performance Challenge
Virtual Network Performance Challenge
Stephen Hemminger
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
Accenture
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
Accenture
 

Similar to Flash memory (20)

Learn OpenStack from trystack.cn ——Folsom in practice
Learn OpenStack from trystack.cn  ——Folsom in practiceLearn OpenStack from trystack.cn  ——Folsom in practice
Learn OpenStack from trystack.cn ——Folsom in practice
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow Demos
 
Networking with Linux on System z
Networking with Linux on System zNetworking with Linux on System z
Networking with Linux on System z
 
Software Defined Data Centers - June 2012
Software Defined Data Centers - June 2012Software Defined Data Centers - June 2012
Software Defined Data Centers - June 2012
 
Xensummit2009 Io Virtualization Performance
Xensummit2009 Io Virtualization PerformanceXensummit2009 Io Virtualization Performance
Xensummit2009 Io Virtualization Performance
 
Windows Server 2012 Hyper-V Networking Evolved
Windows Server 2012 Hyper-V Networking Evolved Windows Server 2012 Hyper-V Networking Evolved
Windows Server 2012 Hyper-V Networking Evolved
 
Edge optical transceivers
Edge optical transceiversEdge optical transceivers
Edge optical transceivers
 
Asml Euv Use Forecast
Asml Euv Use ForecastAsml Euv Use Forecast
Asml Euv Use Forecast
 
Public Presentation, ASML EUV forecast Jul 2010
Public Presentation, ASML EUV forecast Jul 2010Public Presentation, ASML EUV forecast Jul 2010
Public Presentation, ASML EUV forecast Jul 2010
 
OpenStack Quantum
OpenStack QuantumOpenStack Quantum
OpenStack Quantum
 
XS Boston 2008 XenLoop
XS Boston 2008 XenLoopXS Boston 2008 XenLoop
XS Boston 2008 XenLoop
 
Traffic Management, DPI, Internet Offload Gateway
Traffic Management, DPI, Internet Offload GatewayTraffic Management, DPI, Internet Offload Gateway
Traffic Management, DPI, Internet Offload Gateway
 
C3 Citrix Cloud Center
C3 Citrix Cloud CenterC3 Citrix Cloud Center
C3 Citrix Cloud Center
 
Virtual Network Performance Challenge
Virtual Network Performance ChallengeVirtual Network Performance Challenge
Virtual Network Performance Challenge
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
 
Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库Acceleration for big data, hadoop and memcached it168文库
Acceleration for big data, hadoop and memcached it168文库
 
1
11
1
 
Big Data Smarter Networks
Big Data Smarter NetworksBig Data Smarter Networks
Big Data Smarter Networks
 
Cisco open network environment
Cisco open network environmentCisco open network environment
Cisco open network environment
 
New Networking Technology Survey & Analysis
New Networking Technology Survey & AnalysisNew Networking Technology Survey & Analysis
New Networking Technology Survey & Analysis
 

More from Anne Nicolas

Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Anne Nicolas
 

More from Anne Nicolas (20)

Kernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream firstKernel Recipes 2019 - Driving the industry toward upstream first
Kernel Recipes 2019 - Driving the industry toward upstream first
 
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMIKernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
Kernel Recipes 2019 - No NMI? No Problem! – Implementing Arm64 Pseudo-NMI
 
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernelKernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
Kernel Recipes 2019 - Hunting and fixing bugs all over the Linux kernel
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are money
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and future
 
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
Embedded Recipes 2019 - Knowing your ARM from your ARSE: wading through the t...
 
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary dataKernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
 
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
Kernel Recipes 2019 - Analyzing changes to the binary interface exposed by th...
 
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and BareboxEmbedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
Embedded Recipes 2019 - Remote update adventures with RAUC, Yocto and Barebox
 
Embedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less specialEmbedded Recipes 2019 - Making embedded graphics less special
Embedded Recipes 2019 - Making embedded graphics less special
 
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre SiliconEmbedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
Embedded Recipes 2019 - Linux on Open Source Hardware and Libre Silicon
 
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) pictureEmbedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
Embedded Recipes 2019 - From maintaining I2C to the big (embedded) picture
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Embedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmakerEmbedded Recipes 2019 - Herd your socs become a matchmaker
Embedded Recipes 2019 - Herd your socs become a matchmaker
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integration
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimediaEmbedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
Embedded Recipes 2019 - Pipewire a new foundation for embedded multimedia
 
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all startedKernel Recipes 2019 - ftrace: Where modifying a running kernel all started
Kernel Recipes 2019 - ftrace: Where modifying a running kernel all started
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDP
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
 

Recently uploaded

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Flash memory

  • 1. Flash Memory David Woodhouse david@woodhou.se Kernel Recipes September 2012 Software and Services Group
  • 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. The flash cell Diagram © Wikipedia user 'Cyferz' CC BY-SA 3.0 Source Bit Line Line Word Line Control Gate Floating Gate N P N Software and Services Group 3 3
  • 4. NOR flash Diagram © Wikipedia user 'Cyferz' CC BY-SA 3.0 Bit Line N N, GND N N, GND N N, GND N P Software and Services Group 4 4
  • 5. NAND flash Diagram © Wikipedia user 'Cyferz' CC BY-SA 3.0 Bit Line N N N N N N N N N N N P Software and Services Group 5 5
  • 6. NAND flash: one string I/O Software and Services Group 6 6
  • 7. NAND flash: one eraseblock Page I/O I/O 16896 bits per page I/O (2048 bytes + 64 bytes) I/O 64 pages per eraseblock Software and Services Group 7 7
  • 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. 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. 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. Read disturb Other Read Other Page Page Page +5V 0V +5V 0V I/O 0V I/O 0V I/O 0V I/O Disturbed cells Software and Services Group 11 11
  • 12. Single Level Cell Voltage Distribution of 0-level cells Vt – threshold voltage Distribution of 1-level cells Software and Services Group 12 12
  • 13. Multi Level Cell Voltage 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. NAND electrical interface CE RE WE Address Latch Enable (ALE) Command Latch Enable (CLE) NAND Ready/Busy (R/B) chip D0-7 Software and Services Group 14 14
  • 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. Flash Translation Layers 1 2 3 4 5 6 7 8 Software and Services Group 16 16
  • 17. Flash Translation Layers 1 1 2 2 3 3 4 4 5 chain 5 6 6 7 7 8 8 Write sectors 1-4 Software and Services Group 17 17
  • 18. Flash Translation Layers 1 1 1 2 2 2 3 3 3 4 4 4 5 chain 5 chain 5 6 6 6 7 7 7 8 8 8 Write sectors 2, 4, 6 Software and Services Group 18 18
  • 19. Flash Translation Layers 1 1 1 2 2 2 3 3 3 4 4 4 5 chain 5 chain 5 6 6 6 7 7 7 8 8 8 “Fold” chain into its final block Software and Services Group 19 19
  • 20. Flash Translation Layers 1 1 2 2 3 3 4 4 5 chain 5 6 6 7 7 8 8 Erase previous blocks in chain Software and Services Group 20 20
  • 21. Flash Translation Layers 1 2 3 4 5 6 7 8 Erase previous blocks in chain Software and Services Group 21 21
  • 22. TRIM 1 1 1 2 2 2 3 3 3 4 4 4 5 chain 5 chain 5 6 6 6 7 7 7 8 8 8 Software and Services Group 22 22
  • 23. TRIM 1 1 1 2 2 2 3 3 3 4 4 4 5 chain 5 chain 5 6 6 6 7 7 7 8 8 8 TRIM sectors 1, 3 Software and Services Group 23 23
  • 24. TRIM 1 1 1 2 2 2 3 3 3 4 4 4 5 chain 5 chain 5 6 6 6 7 7 7 8 8 8 “Fold” chain into its final block Software and Services Group 24 24
  • 25. TRIM 1 1 2 2 3 3 4 4 5 chain 5 6 6 7 7 8 8 Erase previous blocks in chain Software and Services Group 25 25
  • 26. TRIM 1 2 3 4 5 6 7 8 Erase previous blocks in chain Software and Services Group 26 26
  • 27. An alternative Flash Translation Layer Sect #1 Sect #2 Software and Services Group 27 27
  • 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. 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. 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. MTD support in Linux • Synchronous read/write • Asynchronous erase • ECC for NAND • Bad Block management Software and Services Group 31 31
  • 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. 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. Questions? Software and Services Group 34 34