Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a...

48
Transcendent Memory and Friends (Not just for virtualization anymore!) Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer Dan Magenheimer, Oracle Corp.

Transcript of Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a...

Page 1: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends

(Not just for virtualization anymore!)

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Dan Magenheimer,Oracle Corp.

Page 2: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory’s“Friends”

frontswap

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

cleancache

ephemeralpersistent

Page 3: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory Objectives:

• Utilize RAM more efficiently to obtain

--Lower capital costs in the data center

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

--Lower power utilization in the data center

--Less I/O resulting in better performanceon many workloads

(with negligible loss on other workloads)

Page 4: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Motivation: Memory-inefficient

workloads

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 5: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

More motivation:

The memory capacity wall

100

1000

# Core

GB DRAM

Capacity Wall

� Memory capacity per core drop ~30% every 2 years

1

10

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

Wall

http://isca09.cs.columbia.edu/pres/24.pptxSource: Disaggregated Memory for Expansion and Sharing in Blade Server

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 6: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

More motivation: Energy Savings

“…several studies show the contribution of memory to the total cost and power consumption of future systems increasing

from its current value of about 25%...”

Go

og

le D

ata

Ce

nte

r in

Be

lgiu

m

Source: Disaggregated Memory Architectures for Blade Servers, Kevin Lim, Univ Michigan, PhD Thesis

Go

og

le D

ata

Ce

nte

r in

Be

lgiu

m

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 7: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

<Insert Picture Here>

Slide from: Linux kernel support to exploit phase change memory, Linux Symposium 2010, Youngwoo Park, EE KAIST

Page 8: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Disaggregated memory concept

CPUsDIMM

DIMM

CPUsDIMM

DIMM

CPUsDIMM

DIMM

CPUsDIMM

DIMM

DIMM

DIMM

Exo

fab

ric

DIMM

DIMM

DIMM

DIMM

� Break CPU-memory co-location

Leverage fast, shared communication fabrics

Memory

blade

CPUsDIMM

CPUsDIMM

DIMM

Exo

fab

ricDIMM

8

http://isca09.cs.columbia.edu/pres/24.pptx

Source: Disaggregated Memory for Expansion and Sharing in Blade Server

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 9: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

OS Memory “Demand”

• Operating systems

are memory hogs!OS

Transcendent Memory on Xen (Xen Summit 2009) - Dan Magenheimer

Memory constraint

Page 10: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• Operating systems are

memory hogs!

If you give an

OS

OS Physical Memory Management

Transcendent Memory on Xen (Xen Summit 2009) - Dan Magenheimer

If you give an

operating system

more memory�..

New larger memory constraint

Page 11: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• Operating systems are

memory hogs!

�it uses up any

My name is Linux and I

am a memory hog

OS Physical Memory Management

Transcendent Memory on Xen (Xen Summit 2009) - Dan Magenheimer

�it uses up any

memory you give it!

memory hog

Memory constraint

Page 12: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

OS Memory “Asceticism”

ASSUME that it is “a good thing” for the an OS

to use as little RAM as possible at any given moment

• motivation may be economic or power or virtualization or ???

SUPPOSE there is a mechanism for the OS to surrender RAM

that it doesn’t need at this moment, so it can “pursue goodness”

SUPPOSE there is a mechanism for the OS to ask for and obtain a

page (or more) of RAM when it needs more RAM than it currently has

THEN9 HOW does an OS decide

how much RAM it “needs”?as-cet-i-cism, n. 1. extreme self-denial and austerity; rigorous self-discipline andactive restraint; renunciation of material comforts so as to achieve a higher state

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 13: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 14: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 15: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 16: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 17: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• CAPACITY: “X” GB

• Can read or write to any byte.

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

any byte.

Page 18: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• CAPACITY: “X” GB

• Can read or write to any byte. • CAPACITY: ?????

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

any byte. • CAPACITY: ?????“unknowable”and may changedynamically!

Page 19: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• CAPACITY: known• USES:

-kernel memory

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

-kernel memory-user memory-DMA-etc

• ADDRESSABILITY:Read/write any byte

Page 20: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• CAPACITY: known• USES:

-kernel memory

• CAPACITY-“unknowable”- dynamic

SO9

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

-kernel memory-user memory-DMA-etc

• ADDRESSABILITY:Read/write any byte

SO9kernel/CPU can’t address directly!

SO9Need “permission”to access and needto “follow rules”(even the kernel!)

Page 21: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

• CAPACITY: known• USES:

-kernel memory

• THE RULES1. “page”-at-a-time

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

-kernel memory-user memory-DMA-etc

• ADDRESSABILITY:Read/write any byte

1. “page”-at-a-time2. to put data here,

kernel MUST use a“put page call”

3. (more rules later)

Page 22: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 23: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

And the kernel wants to

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

And the kernel wants to “preserve” Larry in Type B

memory.

Note: All images of Larry the Crocodile are copyright Stephan Pastis

From the “Pearls Before Swine” comic strip dist. by United Feature Syndicate, Inc.

Page 24: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

And the kernel wants to “preserve”

may say NO to kernel!

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

And the kernel wants to “preserve” Larry into Type B memory9 but,

Kernel MUST ask permission and may get told NO!

Page 25: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

And the kernel wants to “preserve”

may say NO to kernel!

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

And the kernel wants to “preserve” Larry into Type B memory.

The kernel has two choices9

Page 26: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

And the kernel wants to “preserve”

may say NO to kernel!

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

And the kernel wants to “preserve” Larry into Type B memory.

Two choices9

1. DEFINITELY want Larry back(e.g. “dirty” page)

may commit to keeping the

page around,

Page 27: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

And the kernel wants to “preserve”

may say NO to kernel!

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

And the kernel wants to “preserve” Larry into Type B memory.

Two choices9

1. DEFINITELY want Larry back

2. PROBABLY want Larry back(e.g. “clean” pages)

may commit to keeping the

page around, or may not!

Page 28: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

Two choices9

1. DEFINITELY want Larry back

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

1. DEFINITELY want Larry back

2. PROBABLY want Larry back

tran-scend-ent, adj., � beyond

the range of normal perception

Page 29: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

We have a page that contains:

Two choices9

1. DEFINITELY want Larry back

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

1. DEFINITELY want Larry back

“PERSISTENT PUT”

2. PROBABLY want Larry back

“EPHEMERAL PUT”

eph-em-er-al, adj., � transitory, existing

only briefly, short-lived (i.e. NOT persistent)

tran-scend-ent, adj., � beyond

the range of normal perception

Page 30: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

“PUT”

“GET”

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

“FLUSH”

Core Transcendent Memory Operations

Page 31: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

“Normal” RAM addressing

• byte-addressable

• virtual address:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

• virtual address: @fffff80001024580

Page 32: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

“Normal” RAM addressing

• byte-addressable

• virtual address:

Transcendent Memory

•object-oriented addressing

•object is a page

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

• virtual address: @fffff80001024580

•“handle” addresses a page

•kernel can (mostly) choosehandle when a page is “put”

•uses same handle to “get”

•must ensure handle is and remains unique

Page 33: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

?

Why bother??

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 34: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Why bother?? Because,

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Because once behind the curtain, we can do

interestingthings,

Page 35: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

compress on put

decompress on get

Interesting thing #1: Zcache

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

“Zcache”(2.6.39 staging driver)

on get

Page 36: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Ooooh…

Interesting thing #2:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Transparently movepre-compressed pages

across a high(??)-speedcoherent(?) interconnect

Ooooh… Larry gotslotsa elbow room over heer..

Page 37: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Interesting thing #2A:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

RAMster:“peer-to-peer” Transcendent Memory

Page 38: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Ooooh… Larry gots lotsa elbow room over

Interesting thing #2B:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

,maybe only one large “memory server” shared

by many machines?

room over heer..

Page 39: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Interesting thing #3:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

SSmem: Transcendent Memory as a “safe” access layer for SSD or NVRAM

e.g. as a “RAM extension” not I/O device

Page 40: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

virtual machines (aka “guests”)

hypervisor

Interesting thing #4:

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

future?

Tmem support:

• multiple guests

• compression

• deduplication

Tmem supported in Xen since 4.0 (2009)

hypervisor (aka “host”)

hypervisor RAM

Page 41: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Impact on Linux Memory Management Subsystem??

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 42: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Memory pressure?So what’s a kernel to do?

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 43: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

? ?

Memory pressure?So what’s a kernel to do?

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 44: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Cleancache (merged for 3.0)

A “third level” “victim” cache for

otherwise Cleancache patchset:

“ephemeral put”

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

otherwise reclaimed clean

page cache pages

(optionally load-balanced across

multiple “clients”)

Cleancache patchset:

• vfs hooks to put clean page cache pages, get them back, and maintain coherency

• per-filesystem opt-in hooks

• shim to zcache in 2.6.39

• shim to Xen tmem in 3.0

Page 45: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Frontswap (target merge 3.2)

Temporary emergency FAST

Frontswap patchset:

• swap subsystem hooks to “put”

“persistent put”

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

emergency FAST swap page store

(optionally load-balanced across

multiple “clients”)

• swap subsystem hooks to “put” swap cache pages and “get” them back, and maintain coherency

• manages tracking data structures (1 bit/page)

• “partial swapoff”

• shim to zcache in 2.6.39

• shim to Xen tmem merged in 3.1

Page 46: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Cleancache & Frontswap

Cleancache and

Zcache, RAMster, Xen

tmem all

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Cleancache and frontswap patches are the only core changes necessary to support ALL of Transcendent Memory’s “friends”!!

tmem all implemented as “drivers”

(no additional core kernel

changes required)

Page 47: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

Questions?

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer

Page 48: Transcendent Memory - Oracle · Transcendent Memory •object-oriented addressing •object is a page Transcendent Memory and Friends: Not just for virtualization anymore! --Linuxcon

BACKUP SLIDESBACKUP SLIDES

Transcendent Memory and Friends: Not just for virtualization anymore! -- Linuxcon 2011 -- Dan Magenheimer