RAMinate Invited Talk at NII

25
RAMinate: Hypervisor-based Virtualization for Hybrid Main Memory Systems The Best Paper Award of ACM Symposium on Cloud Computing 2016 More info: https://github.com/takahiro-hirofuchi/raminate Takahiro Hirofuchi and Ryousei Takano National Institute of Advanced Industrial Science and Technology (AIST) Invited Talk at NII, Tokyo, Dec. 16, 2016

Transcript of RAMinate Invited Talk at NII

Page 1: RAMinate Invited Talk at NII

RAMinate: Hypervisor-based Virtualizationfor Hybrid Main Memory Systems

The Best Paper Award of ACM Symposium on Cloud Computing 2016More info: https://github.com/takahiro-hirofuchi/raminate

Takahiro Hirofuchi and Ryousei TakanoNational Institute of Advanced Industrial Science and Technology (AIST)

Invited Talk at NII, Tokyo, Dec. 16, 2016

Page 2: RAMinate Invited Talk at NII

Emerging Non-volatile Memory (NVM)

A DRAM cell =~ a capacitor

Pinned layer

Free layer

Lowresistance

Highresistance

A MRAM cell =~ ferromagnetism

Energy consuming

• Need refresh energy

• More than 30% of energy consumption of a data center

Not scalable anymore

• Due to serious energy dissipation

Energy efficient

• No refresh energy

Scalable in theory

• Higher density will be possible

2

Page 3: RAMinate Invited Talk at NII

Technology Roadmap on STT-MRAM

Spin Transfer Torque Magnetoresistive RAM (STT-MRAM, in short, we say MRAM here) will achieve the same level of read/write latency as DRAM around 2016.

MRAM can rewrite memory cells without any practical degradation.

However, the write energy will be 10^2 times larger than that of DRAM.

Table 1. Technology roadmap on STT-MRAM and DRAM, according to International Technology Roadmap for Semiconductor 2013

2013 2026

Read Time (ns)DRAM <10 <10

STT-MRAM 35 <10

Write/Erasure Time (ns)DRAM <10 <10

STT-MRAM 35 <1

Write Energy (J/bit)DRAM 4E-15 2E-15

STT-MRAM 2.5E-12 1.5E-13

3

Page 4: RAMinate Invited Talk at NII

Hybrid Main Memory

• Achieve large main memory capacity with small energy consumption

• To avoid write energy problems of MRAM, both DRAM and MRAM must be combined for the main memory of a computer.

• CPU must send most write requests to DRAM.

DRAM(Small)

MRAM(Large)

CPU

Most write requests

4

Page 5: RAMinate Invited Talk at NII

Requirements for Hybrid Memory Systems in IaaS Datacenters

• Transparent to guest operating systems

• A guest OS is under customer’s administrative domain,not service provider’s administrative domain.

• Easy to apply the current server systems

• Extending a memory controller is costly, and should be avoided.

5

Page 6: RAMinate Invited Talk at NII

Assumption

Both DRAM and STT-MRAM are byte-addressable. Both are mapped to different physical address ranges.

MRAM(Large)

DRAM(Small)

Physical Address Mapping

Offset 0 Offset M Offset N

• Future NVM technologies will be also attached to a DIMM interface

• Note: Currently, DIMM-based Flash modules are already on the market.

6

Page 7: RAMinate Invited Talk at NII

2. Determine necessary page swap

operations

1. Detect written pages

3. Update page mapping

MRAM PoolDRAM Pool

1GB 3GB

VM (DRAM 4GB)

RAMinate (Qemu/KVM)

RAMinate: Hybrid Memory Support at Hypervisor

Provide transparency to guest operating systems without any modification to existing memory controllers.

7

Page 8: RAMinate Invited Talk at NII

How RAMinate works (1)

8

MRAM PoolDRAM Pool

1a. Detect write-intensive guest physical pages on MRAM

Page 9: RAMinate Invited Talk at NII

How RAMinate works (2)

9

MRAM PoolDRAM Pool

1b. Detect guest physical pages on DRAMthat have few write operations

Page 10: RAMinate Invited Talk at NII

How RAMinate works (3)2. Swap write-intensive MRAM pages

with DRAM pages having few write requests

10

MRAM PoolDRAM Pool

Divert write traffic to DRAMbehind the guest OS

Page 11: RAMinate Invited Talk at NII

Component 1. RAMinate periodically scans Extended Page Table entries of a VM and finds dirty guest pages.

9

EPT maintains mapping between guest frame numbers and physical frame numbers. When a guest page is written, CPU sets the dirty bit.

Page 12: RAMinate Invited Talk at NII

12

Component 2. The optimization algorithm, Corked Multi Queue, determines which guest pages must be migrated.

The queue level relates to the number of past page updates. MRAM pages in higher levels of queues are candidates for page migration.

Q0Q1Q2Q3

Q0Q1Q2Q3

Promote a page when the number of past detected updates of a page exceeds a threshold value.

Demote a page when the elapsed time from its last update exceeds a threshold value.

Page 13: RAMinate Invited Talk at NII

Simulation

• Compare CMQ, LRU and nothing• Use trace data during SPEC CPU 2006

13

DRAM hit ratio The number of swapped pages

CMQ drastically reduces the number of necessary page swaps.

Page 14: RAMinate Invited Talk at NII

14

Component 3. RAMinate dynamically updates page mapping between guest and physical pages without disrupting the guest operating system.

Page 15: RAMinate Invited Talk at NII

Page Swap in Detail

• Temporary stop the VM during optimization1. Stop the VM2. Repeat page swap operations

1. Swap the PFNs of 2 EPT entries2. Swap the data of the memory pages

3. Restart the VM

15

Page 16: RAMinate Invited Talk at NII

Page Swap Overhead

• Downtime is approximately 30ms for 1000 swap operations.

• Short enough, acceptable– Page mapping optimization is performed every 5

second in the default setting.

16

Page 17: RAMinate Invited Talk at NII

Experiments

17

CH3

RAMinate

CH2CH1

Host OS

CH0

• Use one memory channel for MRAM• Disable memory channel interleaving• Measure read/write traffic per memory

channel by PMU– CAS_COUNT.RD Counter– CAS_COUNT.WR Counter

VM

PMUPMUPMUPMU

DRAMPool

MRAMPool

Page 18: RAMinate Invited Talk at NII

Kernel Compile (DRAM 40MB, MRAM 3960MB)

18

First, most write traffic went to MRAM. After optimized, only 50%.

Page 19: RAMinate Invited Talk at NII

The Total Amount of Written Data to DRAM and MRAM in GB

19

The DRAM size is 10% of VM memory (400MB).

A smaller interval of optimization reduced the ratio of MRAM traffic, but increased the total of written data because of memory copy operations for page swaps. (Also, there is more performance overhead in a smaller interval. )

Page 20: RAMinate Invited Talk at NII

The Number of Page Swaps

20

Page 21: RAMinate Invited Talk at NII

Overhead on Application Performance

21

A shorter interval of optimization costs greater impact on application performance. Overhead is larger than expected, due to EPT cache flush (?)

Page 22: RAMinate Invited Talk at NII

Energy Estimation

• Explore how much energy can be saved (or wasted)if RAMinate is applied to future STT-MRAM devices

• First, develop energy models of DRAM and STT-MRAM

• Next, estimate energy consumption by applyingobtained the data through the experiments to the

models

22

Page 23: RAMinate Invited Talk at NII

Energy Models

• DRAM– X: Read data size (MB)– Y: Written data size (MB)– P: Idle Power (W) per VM– T: Duration of an experiment (s)– Energy (J) = a*X + a*Y + P*T

• STT-MRAM with 100x write energy– X: Read data size (MB)– Y: Written data size (MB)– Energy (J) = a*X + (100*a)*Y

23

• Assume a simple linear correlationbetween read/write throughput and energy consumption

• Sufficient for discussing orders of magnitudes larger write energy

Page 24: RAMinate Invited Talk at NII

Estimated Energy Consumption

24

• Assume MRAM write energy x10^2 than that of DRAM.Other values are discussed in the paper.

• Hybrid memory with 10% DRAM outperformed DRAM-only memory in most cases.

Page 25: RAMinate Invited Talk at NII

まとめ

• RAMinate: DRAMと次世代不揮発メモリを使い分ける仕組み– アプリケーションの変更不要– メモリコントローラの変更不要– 我々の知る限り、ハイパーバイザでハイブリッドメモリに対応した最初の研究

• 評価– Qemu/KVMを拡張して実装– STT-MRAMは手に入らないので、評価実験も工夫– STT-MRAMに対する書き込み量を70%削減– 消費電力を50%削減

25

論文やスライド等を https://github.com/takahiro-hirofuchi/raminate で公開してます。