Distributed Shared Persistent Memory - NVMW...

33
Distributed Shared Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang

Transcript of Distributed Shared Persistent Memory - NVMW...

Page 1: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Distributed Shared Persistent Memory

(SoCC ’17)Yizhou Shan, Yiying Zhang

Page 2: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Persistent Memory (PM/NVM)

Byte Addressable Persistent Low Latency Capacity Cost effective

CPU

Cache

DRAMPM

2

Page 3: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Many PM Work, but All in Single Machine

• Local memory models– NV-Heaps [ASPLOS ’11], Mnemosyne [ASPLOS ’11]– Memory Persistency [ISCA ’14], Synchronous Ordering [Micro’16]

• Local file systems– BPFS [SOSP’09], PMFS [EuroSys’14], SCMFS [SC’11], HiNFS [EuroSys’16]

• Local transaction/logging systems– NVWAL [ASPLOS’16], SCT/DCT [ASPLOS’16], Kamino-Tx [Eurosys’17]

3

Page 4: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

• PM fits datacenter- Applications require a lot memory- and accessing persistent data fast- with low monetary cost

•Challenges- Handle node failure- Ensure good performance and scalability- Easy-to-use abstraction

4

Moving PM into Datacenters

Page 5: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

How to Use PM in Distributed Environments?

• As distributed memory?• As distributed storage?

• Mojim [Zhang etal., ASPLOS’15]- First PM work in distributed environments- Efficient PM replication- But far from a full-fledged distributed NVM system

5

Page 6: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Node 1 Node 2

6

8GB Main Memory

Core Core Core Core Core Core

VM1 App1

4GB Main Memory

Core Core Core Core

Container1

Resource Allocation in Datacenters

3GB Memory

Core

App2

Page 7: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

7

Resource Utilization in Production Clusters

Unused Resource + Waiting/Killed Jobs Because of Physical-Node Constraints

* Google Production Cluster Trace Data. “https://github.com/google/cluster-data”

Page 8: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

8

Q1: How to achieve better resource utilization?

Use remote memory

Page 9: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Node 1 Node 2

9

Main Memory

Core Core Core Core Core Core

VM1 App1

Main Memory

Core Core Core Core

Container1

Distributed (Remote) Memory

App2

Memory

Core

App2

Page 10: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Purdue ECE WukLab

•  

PowerGraph

TensorFlow10

Modern Datacenter Applications Have Significant Memory Sharing

Page 11: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

11

Q2: How to scale out parallel applications?

Distributed shared memory

Page 12: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

What about persistence?• Data persistence is useful - Many existing data storage systems➡Performance- Memory-based, long-running applications➡Checkpointing

12

Page 13: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

13

Q3: How to provide data persistence?

Page 14: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Distributed Shared Persistent Memory (DSPM)

a significant step towards using PM in datacenters

DSM

14

Page 15: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

DSPM• Native memory load/store interface– Local or remote (transparent)– Pointers and in-memory data structures

• Supports memory read/write sharing

15

Page 16: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Distributed Shared Persistent Memory (DSPM)

a significant step towards using PM in datacenters

DSM

16

Page 17: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

DSPM• Memory load/store interface– Local or remote (transparent)– Pointers and in-memory data structures

• Supports memory read/write sharing

• Persistent naming• Data durability and reliability

17

(Distributed)  Memory

(Distributed)  Storage

DSPM: One Layer Approach

Benefits of both memory and storage No redundant layers No data marshaling/unmarshalling

Page 18: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Hotpot:A Kernel-Level RDMA-BasedDSPM System• Easy to use• Native memory interface• Fast, scalable• Flexible consistency levels• Data durability & reliability

18

Page 19: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Hotpot Architecture

19

Page 20: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Hotpot Architecture

20

Page 21: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

21

Hotpot Architecture

Page 22: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

22

Hotpot Architecture

Page 23: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

23

Hotpot Architecture

Page 24: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

24

Hotpot Architecture

Page 25: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Hotpot Code Example

/* Open a dataset named 'boilermaker’ */int fd = open(”/mnt/hotpot/boilermaker”, O_CREAT|O_RDWR);

/* map it to application’s virtual address space */void *base = mmap(0, 40960, PROT_WRITE, MAP_PRIVATE, fd, 0);

/* First access: Hotpot will fetch page from remote */

*base = 9;

/* Later accesses: Direct memory load/store */

memset(base, 0x27, PAGE_SIZE);

/* Commit data: making data coherent, durable, and replicated */

msync(sg_addr, sg_len, MSYNC_HOTPOT);

25

Page 26: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

How to efficiently add P to “DSM”?• Distributed Shared Memory- Cache remote memory on-demand for fast local access- Multiple redundant copies

• Distributed Storage Systems- Actively add more redundancy to provide data reliability

Integrate two forms of redundancy with morphable page states

26One Layer Principle

Page 27: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Morphable Page States• A PM page can serve different purposes, possibly

at different times• as a local cached copy to improve performance• as a redundant data page to improve data reliability

10/9/17 27

Node  2Node  1

3 1 4 2 423 1 3

Node 2 accesses page 3

Page 28: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

• When to make cached copies coherent?• When to make data durable and reliability?

• Observations- Data-store applications have well-defined commit points- Commit points: time to make data persistent- Visible to storage devices => visible to other nodes

Exploit application behavior: Make data coherent only at commit points

28

How to efficiently add P to “DSM”?

Page 29: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Commit Point

29

Node 1 Node 2 Node 3

PM

A

CPU cache

A’

CPU cache

PM PM

CPU cache

A

A’A’

• durable • coherent • reliable

B’

B

• single-node and distributed consistency• two consistency modes: single/multiple writer

C

C’

Page 30: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Flexible Coherence Levels• Multiple Reader Multiple Writer (MRMW) - Allows multiple concurrent dirty copies- Great parallelism, but weaker consistency- Three-phase commit protocol

• Multiple Reader Single Writer (MRSW) - Allows only one dirty copy- Trades parallelism for stronger consistency- Single phase commit protocol

30

Page 31: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

MongoDB Results• Modify MongoDB with ~120 LOC, use MRMW mode• Compare with tmpfs, PMFS, Mojim, Octopus using YCSB

10/9/17 31

Page 32: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

• One layer approach: challenges and benefits

• Hotpot: a kernel-level RDMA-based DSPM system

• Hide complexity behind simple abstraction

• Calls for attention to use PM in datacenter

•Many open problems in distributed PM!32

Conclusion

Page 33: Distributed Shared Persistent Memory - NVMW 2020nvmw.ucsd.edu/nvmw2018-program/unzip/current/nvmw2018...Persistent Memory (SoCC ’17) Yizhou Shan, Yiying Zhang Persistent Memory (PM/NVM)

Thank You Questions?

Get Hotpot at: https://github.com/WukLab/Hotpot

wuklab.io