ece 598-ms: advanced memory and storage systems
TRANSCRIPT
ECE 598-MS: Advanced Memory and Storage Systems
Jian Huang
Lecture 7: Unified Address Translation with
FlashMap
Use Flash As Non-Volatile Memory
2
HDD
(milliseconds)
SSD
(microseconds)
DRAM
(nanoseconds)
Application Memory
Component
Designed for
fast memory
Application Storage
Component
Designed for
slow disk
Application Memory
Component
Application Storage
Component
Use Flash As Non-Volatile Memory
2
HDD
(milliseconds)
SSD
(microseconds)
DRAM
(nanoseconds)
Application Memory
Component
Designed for
fast memory
Application Storage
Component
Designed for
slow disk
Application Memory
Component
Application Storage
Component 0.3-0.9%40%
Use Flash As Non-Volatile Memory
2
HDD
(milliseconds)
SSD
(microseconds)
DRAM
(nanoseconds)
Application Memory
Component
Designed for
fast memory
Application Storage
Component
Designed for
slow disk
Memory Mapped SSD
3
Application SSDVirtual Memory Filesystem
File
Memory Mapped SSD
3
Application SSDVirtual Memory Filesystem
File
mmap()
munmap()
msync()
Memory Mapped SSD
3
Application SSDVirtual Memory
Extended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
Memory Mapped SSD
3
Minimal Code
Modifications
+
Application SSDVirtual Memory
Extended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
Memory Mapped SSD
3
Minimal Code
Modifications
+
Application SSDVirtual Memory
+Data
DurabilityExtended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
Page Table &Memory Manager
Virtual Address
Physical Address/File Offset
page fault
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
Page Table &Memory Manager
Virtual Address
Physical Address/File Offset
File Index
File Offset
Logical Block Address
page fault
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
Page Table &Memory Manager
Virtual Address
Physical Address/File Offset
File Index
File Offset
Logical Block Address
FTL
Logical Block Address
Physical Block Address
page fault
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
Page Table &Memory Manager
Virtual Address
Physical Address/File Offset
File Index
File Offset
Logical Block Address
FTL
Logical Block Address
Physical Block Address
page fault
3 address translations
+ 2 boundary checks
+ 2 permission checks
-----------------------------
= Latency:
15 – 20 microseconds
+ Metadata Overhead
FlashMap: Unified Address Translation
5
Application
Flash
Virtual Memory System
Flash Translation Layer
File System
FlashMap: Unified Address Translation
5
Application
Flash
Unified Address Translation
1 Reduced Storage, only 1 mapping table
2 Reduced Latency
only 1 address translation + 1 permission check + 1 boundary check
FlashMapChallenges
6
Application
Virtual Memory System
File System
Flash Translation Layer
Flash
FlashMapChallenges
6
Application
Virtual Memory System
File System
Flash Translation Layer
Flash
Page table is process-specific & private
File index is system-wide shared resource
Mapping table is shared and should be persisted
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File SystemFile
Virtual Memory
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File System
VM Region
File
Virtual Memory
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
PGD PUD PMD PTE Offset
…
File
Virtual Memory
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
PGD PUD PMD PTE Offset
…
File
Page table is process-specific & private
Virtual Memory
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
PGD PUD PMD PTE Offset
…
File
Only for mapped file
Virtual Memory
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
Shared Page Table
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
Shared Page Table
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
READ_ONLY READ_WRITE
Shared Page Table
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
READ_ONLY READ_WRITE
Permission
Conflict !!!
Shared Page Table
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
READ_ONLY READ_WRITE
Only share the leaf-level page table pagesShared Page Table
Preserving File System Permissions
8
Flash Translation Layer
Flash
Process A
File System
VM Region
Page Table
Mapped File
Process B
VM Region
Page Table
PGD PUD PMD PTE Offset
…
READ_ONLY READ_WRITE
Shared Page Table
Preserving Memory Protections
9
Flash Translation Layer
Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Private
leaf-level page table
Private Private
Shared
Preserving Memory Protections
9
Flash Translation Layer
Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Custom memory protection?Private
leaf-level page table
Preserving Memory Protections
9
Flash Translation Layer
Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Private
leaf-level page table
Combining FTL and Shared Page Table
10
Flash Translation Layer
Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Combining FTL and Shared Page Table
10Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Mapping Table Garbage Collection ECC Wear Leveling
Combining FTL and Shared Page Table
10Flash
File SystemMapped File
Shared Leaf-level Page Table
…
Process A
PGD PUD PMD PTE Offset
Process B
PGD PUD PMD PTE Offset
Garbage Collection ECC Wear Leveling
Overloaded PTE
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
…
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
…
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
… page fault
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
…update PTE
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
DRAM hit
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
DRAM miss
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…update PTE
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
GC
…
Metadata Size for 1 TB SSD
12
0
1
2
3
4
5
6
7
Meta
dat
a Si
ze (
GB
)
Baseline (mmap + EXT4 + FTL with page level mapping)
FTL + FS (mmap + combined FTL & filesystem)
FlashMap
50%
Reduction
Latency Reduction with FlashMap
13
0
10
20
30
40
50
5 10 15 20 25
Lat
ency
(us)
Device latency (microseconds)
Baseline FTL+FS FlashMap
Latency Reduction with FlashMap
13
0
10
20
30
40
50
5 10 15 20 25
Lat
ency
(us)
Device latency (microseconds)
Baseline FTL+FS FlashMap
The combination of page table and file system
contributes mostly to the latency reduction
Benefits from Reduced Latency (Database)
14
0
5
10
15
20
25
25 20 15 10 5
Thro
ugh
put
(K T
PS)
Device Latency (us)
Baseline FTL+FS FlashMap
As Flash becomes faster,
FlashMap provides more performance benefits for latency-critical apps
FlashMapImpact
15
Metadata Size
50%
Performance
1.8x
Latency
53%
FlashMapImpact
15
Unifying emerging memory and storage
e.g., storage-class memory
Impact on industry
How to use scalable SSD in data center