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

What's hot (20)

Memoria RAM
Memoria RAMMemoria RAM
Memoria RAM
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
 
Flash memory
Flash memoryFlash memory
Flash memory
 
Hard Disk Drive
Hard Disk Drive Hard Disk Drive
Hard Disk Drive
 
Optical memory
Optical memoryOptical memory
Optical memory
 
RAM
RAMRAM
RAM
 
Memory interfacing of microcontroller 8051
Memory interfacing of microcontroller 8051Memory interfacing of microcontroller 8051
Memory interfacing of microcontroller 8051
 
GRAPHIC CARD
GRAPHIC CARDGRAPHIC CARD
GRAPHIC CARD
 
System-on-Chip
System-on-ChipSystem-on-Chip
System-on-Chip
 
PCI Slot
PCI SlotPCI Slot
PCI Slot
 
Medios de almacenamiento de datos
Medios de almacenamiento de datosMedios de almacenamiento de datos
Medios de almacenamiento de datos
 
Internal memory
Internal memoryInternal memory
Internal memory
 
Flash memory
Flash memoryFlash memory
Flash memory
 
RISC-V Foundation Overview
RISC-V Foundation OverviewRISC-V Foundation Overview
RISC-V Foundation Overview
 
Memory system
Memory systemMemory system
Memory system
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
System On Chip
System On ChipSystem On Chip
System On Chip
 
Componentes ordenador
Componentes ordenadorComponentes ordenador
Componentes ordenador
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 
Expansion slot report
Expansion slot reportExpansion slot report
Expansion slot report
 

Similar to Flash memory

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 practiceOpenCity Community
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosBrent Salisbury
 
Software Defined Data Centers - June 2012
Software Defined Data Centers - June 2012Software Defined Data Centers - June 2012
Software Defined Data Centers - June 2012Brent Salisbury
 
Xensummit2009 Io Virtualization Performance
Xensummit2009 Io Virtualization PerformanceXensummit2009 Io Virtualization Performance
Xensummit2009 Io Virtualization PerformanceThe Linux Foundation
 
Edge optical transceivers
Edge optical transceiversEdge optical transceivers
Edge optical transceiversEDGEtech
 
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 2010JVervoort
 
Traffic Management, DPI, Internet Offload Gateway
Traffic Management, DPI, Internet Offload GatewayTraffic Management, DPI, Internet Offload Gateway
Traffic Management, DPI, Internet Offload GatewayContinuous Computing
 
C3 Citrix Cloud Center
C3 Citrix Cloud CenterC3 Citrix Cloud Center
C3 Citrix Cloud CenterRui Lopes
 
Virtual Network Performance Challenge
Virtual Network Performance ChallengeVirtual Network Performance Challenge
Virtual Network Performance ChallengeStephen 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
 
Cisco open network environment
Cisco open network environmentCisco open network environment
Cisco open network environmentdeepers
 
New Networking Technology Survey & Analysis
New Networking Technology Survey & AnalysisNew Networking Technology Survey & Analysis
New Networking Technology Survey & AnalysisIT Brand Pulse
 

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
 
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
 
Asml Euv Use Forecast
Asml Euv Use ForecastAsml Euv Use Forecast
Asml Euv Use Forecast
 
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 - 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 firstAnne Nicolas
 
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-NMIAnne Nicolas
 
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 kernelAnne Nicolas
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyAnne Nicolas
 
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 futureAnne Nicolas
 
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...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 dataAnne Nicolas
 
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...Anne Nicolas
 
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 BareboxAnne Nicolas
 
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 specialAnne Nicolas
 
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 SiliconAnne Nicolas
 
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) pictureAnne Nicolas
 
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 wayAnne Nicolas
 
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 matchmakerAnne Nicolas
 
Embedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationEmbedded Recipes 2019 - LLVM / Clang integration
Embedded Recipes 2019 - LLVM / Clang integrationAnne Nicolas
 
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 debuggingAnne Nicolas
 
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 multimediaAnne Nicolas
 
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 startedAnne Nicolas
 
Kernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPKernel Recipes 2019 - Suricata and XDP
Kernel Recipes 2019 - Suricata and XDPAnne Nicolas
 
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)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

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

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