![Page 1: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/1.jpg)
ECE 598-MS: Advanced Memory and Storage Systems
Jian Huang
Lecture 7: Unified Address Translation with
FlashMap
![Page 2: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/2.jpg)
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
![Page 3: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/3.jpg)
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%
![Page 4: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/4.jpg)
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
![Page 5: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/5.jpg)
Memory Mapped SSD
3
Application SSDVirtual Memory Filesystem
File
![Page 6: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/6.jpg)
Memory Mapped SSD
3
Application SSDVirtual Memory Filesystem
File
mmap()
munmap()
msync()
![Page 7: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/7.jpg)
Memory Mapped SSD
3
Application SSDVirtual Memory
Extended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
![Page 8: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/8.jpg)
Memory Mapped SSD
3
Minimal Code
Modifications
+
Application SSDVirtual Memory
Extended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
![Page 9: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/9.jpg)
Memory Mapped SSD
3
Minimal Code
Modifications
+
Application SSDVirtual Memory
+Data
DurabilityExtended
Memory
YAY!
MORE MEM!!!
Filesystem
File
mmap()
munmap()
msync()
![Page 10: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/10.jpg)
No Free Lunch: Software Overhead
4
Virtual Memory System
Application
Flash Translation Layer
Flash
File System
![Page 11: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/11.jpg)
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
![Page 12: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/12.jpg)
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
![Page 13: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/13.jpg)
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
![Page 14: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/14.jpg)
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
![Page 15: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/15.jpg)
FlashMap: Unified Address Translation
5
Application
Flash
Virtual Memory System
Flash Translation Layer
File System
![Page 16: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/16.jpg)
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
![Page 17: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/17.jpg)
FlashMapChallenges
6
Application
Virtual Memory System
File System
Flash Translation Layer
Flash
![Page 18: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/18.jpg)
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
![Page 19: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/19.jpg)
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File SystemFile
Virtual Memory
![Page 20: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/20.jpg)
Combining Page Table and File System
7
Flash Translation Layer
Flash
Process A
File System
VM Region
File
Virtual Memory
![Page 21: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/21.jpg)
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
![Page 22: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/22.jpg)
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
![Page 23: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/23.jpg)
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
![Page 24: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/24.jpg)
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
![Page 25: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/25.jpg)
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
![Page 26: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/26.jpg)
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
![Page 27: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/27.jpg)
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
![Page 28: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/28.jpg)
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
![Page 29: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/29.jpg)
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
![Page 30: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/30.jpg)
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
![Page 31: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/31.jpg)
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
![Page 32: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/32.jpg)
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
![Page 33: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/33.jpg)
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
![Page 34: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/34.jpg)
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
![Page 35: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/35.jpg)
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
![Page 36: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/36.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
…
![Page 37: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/37.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE Offset
Read
DRAM
…
![Page 38: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/38.jpg)
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
![Page 39: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/39.jpg)
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
![Page 40: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/40.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
![Page 41: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/41.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
DRAM hit
![Page 42: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/42.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
DRAM miss
![Page 43: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/43.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…update PTE
![Page 44: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/44.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
Write
…
![Page 45: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/45.jpg)
Mapped File
Flash
Put It All Together
11
Process A
Shared Leaf-level Page Table Pages
PGD PUD PMD PTE OffsetDRAM
GC
…
![Page 46: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/46.jpg)
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
![Page 47: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/47.jpg)
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
![Page 48: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/48.jpg)
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
![Page 49: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/49.jpg)
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
![Page 50: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/50.jpg)
FlashMapImpact
15
Metadata Size
50%
Performance
1.8x
Latency
53%
![Page 51: ECE 598-MS: Advanced Memory and Storage Systems](https://reader033.vdocuments.site/reader033/viewer/2022042219/625a18d390330e514e715250/html5/thumbnails/51.jpg)
FlashMapImpact
15
Unifying emerging memory and storage
e.g., storage-class memory
Impact on industry
How to use scalable SSD in data center