ece 598-ms: advanced memory and storage systems

51
ECE 598-MS: Advanced Memory and Storage Systems Jian Huang Lecture 7: Unified Address Translation with FlashMap

Upload: others

Post on 16-Apr-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECE 598-MS: Advanced Memory and Storage Systems

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

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

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

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

Memory Mapped SSD

3

Application SSDVirtual Memory Filesystem

File

Page 6: ECE 598-MS: Advanced Memory and Storage Systems

Memory Mapped SSD

3

Application SSDVirtual Memory Filesystem

File

mmap()

munmap()

msync()

Page 7: ECE 598-MS: Advanced Memory and Storage Systems

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

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

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

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

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

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

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

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

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

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

FlashMapChallenges

6

Application

Virtual Memory System

File System

Flash Translation Layer

Flash

Page 18: ECE 598-MS: Advanced Memory and Storage Systems

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

FlashMapImpact

15

Metadata Size

50%

Performance

1.8x

Latency

53%

Page 51: ECE 598-MS: Advanced Memory and Storage Systems

FlashMapImpact

15

Unifying emerging memory and storage

e.g., storage-class memory

Impact on industry

How to use scalable SSD in data center