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

SRAM read and write and sense amplifier
SRAM read and write and sense amplifierSRAM read and write and sense amplifier
SRAM read and write and sense amplifier
Soumyajit Langal
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontroller
Diwaker Pant
 
Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
SambitShreeman
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 

What's hot (20)

SRAM read and write and sense amplifier
SRAM read and write and sense amplifierSRAM read and write and sense amplifier
SRAM read and write and sense amplifier
 
Interfacing methods of microcontroller
Interfacing methods of microcontrollerInterfacing methods of microcontroller
Interfacing methods of microcontroller
 
SoC based smartphone processors
SoC based smartphone processorsSoC based smartphone processors
SoC based smartphone processors
 
SRAM
SRAMSRAM
SRAM
 
EC6601 VLSI Design Memory Circuits
EC6601 VLSI Design   Memory CircuitsEC6601 VLSI Design   Memory Circuits
EC6601 VLSI Design Memory Circuits
 
Crosstalk
CrosstalkCrosstalk
Crosstalk
 
Semiconductor memory
Semiconductor memorySemiconductor memory
Semiconductor memory
 
DRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write OperationsDRAM Cell - Working and Read and Write Operations
DRAM Cell - Working and Read and Write Operations
 
ROM (Read Only Memory)
ROM (Read Only Memory)ROM (Read Only Memory)
ROM (Read Only Memory)
 
Carbon Nanotubes
Carbon NanotubesCarbon Nanotubes
Carbon Nanotubes
 
Lecture14
Lecture14Lecture14
Lecture14
 
DDR4 SDRAM : Notes
DDR4 SDRAM : NotesDDR4 SDRAM : Notes
DDR4 SDRAM : Notes
 
Fully depleted silicon insulator
Fully depleted silicon insulatorFully depleted silicon insulator
Fully depleted silicon insulator
 
Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
 
Basic knowledge of ldo voltage regulators
Basic knowledge of ldo voltage regulatorsBasic knowledge of ldo voltage regulators
Basic knowledge of ldo voltage regulators
 
Esd protection
Esd protectionEsd protection
Esd protection
 
IC Fabrication Process
IC Fabrication ProcessIC Fabrication Process
IC Fabrication Process
 
Thermal Reliability for FinFET based Designs
Thermal Reliability for FinFET based DesignsThermal Reliability for FinFET based Designs
Thermal Reliability for FinFET based Designs
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Memory card
Memory cardMemory card
Memory card
 

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

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 

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