CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Appears in SOSDI.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Virtual Memory (II) CSCI 444/544 Operating Systems Fall 2008.
Paging: Design Issues. Readings r Silbershatz et al: ,
Chapter 8 Virtual Memory
Virtualization Dr. Michael L. Collard
Virtualization Technology
Virtualisation From the Bottom Up From storage to application.
VMWare ESX Memory Management Dr. Sanjay P. Ahuja, Ph.D FIS Distinguished Professor of Computer Science School of Computing, UNF.
Memory Resource Management in Vmware ESX Server Author: Carl A. Waldspurger Vmware, Inc. Present: Jun Tao.
Difference Engine: Harnessing Memory Redundancy in Virtual Machines by Diwaker Gupta et al. presented by Jonathan Berkhahn.
Copyright ©: Lawrence Angrave, Vikram Adve, Caccamo 1 Virtual Memory III.
CSE 598B: Self-* Systems Memory Resource Management in VMware ESX Server by Carl A. Waldspurger Presented by: Arjun R. Nath (slide material adapted from.
Page 15/4/2015 CSE 30341: Operating Systems Principles Allocation of Frames  How should the OS distribute the frames among the various processes?  Each.
Xen , Linux Vserver , Planet Lab
Memory Buddies: Exploiting Page Sharing for Smart Colocation in Virtualized Data Centers Timothy Wood, Gabriel Tarasuk-Levin, Prashant Shenoy, Peter Desnoyers*,
G Robert Grimm New York University Disco.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
Virtual Memory Deung young, Moon ELEC 5200/6200 Computer Architecture and Design Lectured by Dr. V. Agrawal Lectured by Dr. V.
Virtualization and the Cloud
Main Memory. Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are only.
Virtualization for Cloud Computing
Virtualization 101.
Virtualization 101.
Virtualization Performance H. Reza Taheri Senior Staff Eng. VMware.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines Mark Zbikowski and Gary Kimura.
Tanenbaum 8.3 See references
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Modularizing B+-trees: Three-Level B+-trees Work Fine Shigero Sasaki* and Takuya Araki NEC Corporation * currently with 1st Nexpire Inc.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
A Cloud is a type of parallel and distributed system consisting of a collection of inter- connected and virtualized computers that are dynamically provisioned.
Disco : Running commodity operating system on scalable multiprocessor Edouard et al. Presented by Jonathan Walpole (based on a slide set from Vidhya Sivasankaran)
CS533 Concepts of Operating Systems Jonathan Walpole.
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Improving Network I/O Virtualization for Cloud Computing.
Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.
Embedded System Lab. 오명훈 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Palo Alto, CA USA
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
Virtualization Part 2 – VMware. Virtualization 2 CS5204 – Operating Systems VMware: binary translation Hypervisor VMM Base Functionality (e.g. scheduling)
Our work on virtualization Chen Haogang, Wang Xiaolin {hchen, Institute of Network and Information Systems School of Electrical Engineering.
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Edouard et al. Madhura S Rama.
Virtualization Part 2 – VMware Hardware Support. Virtualization 2 CS 5204 – Fall, 2008 VMware: binary translation Hypervisor VMM Base Functionality (e.g.
Supporting Multi-Processors Bernard Wong February 17, 2003.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
Disco : Running commodity operating system on scalable multiprocessor Edouard et al. Presented by Vidhya Sivasankaran.
1 Virtual Machine Memory Access Tracing With Hypervisor Exclusive Cache USENIX ‘07 Pin Lu & Kai Shen Department of Computer Science University of Rochester.
A summary by Nick Rayner for PSU CS533, Spring 2006
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
VMWare MMU Ranjit Kolkar. Designed for efficient use of resources. ESX uses high-level resource management policies to compute a target memory allocation.
MEMORY RESOURCE MANAGEMENT IN VMWARE ESX SERVER 김정수
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Full and Para Virtualization
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Memory Resource Management in VMware ESX Server By Carl A. Waldspurger Presented by Clyde Byrd III (some slides adapted from C. Waldspurger) EECS 582 –
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Virtualization.
Memory Resource Management in VMware ESX Server
Memory COMPUTER ARCHITECTURE
1. 2 VIRTUAL MACHINES By: Satya Prasanna Mallick Reg.No
OS Virtualization.
Page Replacement.
Main Memory Background Swapping Contiguous Allocation Paging
CSE451 Virtual Memory Paging Autumn 2002
Lecture 3: Main Memory.
Virtual Memory: Working Sets
COMP755 Advanced Operating Systems
System Virtualization
Presentation transcript:

CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Appears in SOSDI 2002 Presented by: Lei Yang

Outline Introduction –Background –Motivation Featuring techniques – – – – Memory virtualization Memory reclamation Memory sharing Memory utilization Higher level allocation policies Conclusions Extra level of address translation Ballooning Content-based page sharing Idle memory taxation

Background Virtual Machine Monitor –Diso, Cellular Diso –VMware VMware ESX Server –A thin software layer designed to multiplex hardware resources efficiently among virtual machines running unmodified commodity operating systems –Differs from VMware Workstation The latter needs a hosted OS, e.g., a Linux-host VM running a Windows XP guest OS. ESX Server manage system hardware directly. –Current system virtualizes the Intel IA-32 architecture

Motivation Problem –How to flexibly overcommit memory to reap the benefits of statistical multiplexing, while… –Still providing resource guarantees to VMs of varying importance? –Need for efficient memory management techniques! Goal –Allocating memory across virtual machines running existing operating systems without modification

Consistent! Memory Virtualization Guest OS expects a zero-based physical address space ESX Server gives each VM this illusion, by –Adding an extra level of address translation –Machine address: actual hardware memory –Physical address: illusion of hardware memory to VM –Pmap: physical-to-machine page mapping –Shadow page table: virtual-to-machine page mapping No additional performance overhead – Hardware TLB will cache direct virtual-to-machine address translations read from the shadow page table Flexible – Server can remap a physical page by changing pmap – Server can monitor guest memory access

Memory Reclamation Memory overcommitment –Total size configured for all running VM exceeds the total amount of actual machine memory –When memory is overcommitted, reclaim space from one or more of the VMs Conventional page replacement –Introduce an extra level of paging: moving some VM physical pages to a swap area on disk –Problems: Choose VM first and then choose pages Performance anomalies Diverse OS replacement policies Double paging

Ballooning Implicitly coaxes a guest OS into reclaiming memory using its own native page replacement algorithms.

Ballooning, pros and cons Goal achieved, more or less –A VM from which memory has been reclaimed should perform as if it had been configured with less memory Limitations –As a kernel module, balloon driver can be uninstalled or disabled explicitly –Not available while a guest OS is booting –Temporarily unable to reclaim memory quickly enough –Upper bounds of balloon sizes?

Balloon Performance Throughput of single Linux VM running dbench with 40 clients, as a function of VM size Gray: same VM configured with 256MB, ballooned down to specified size Black: VM configured with different fixed memory size Overhead: 4.4% to 1.4%

Memory Sharing When could memory sharing happen? –VMs running instances of same guest OS –VMs have same applications or components loaded –VMs application contain common data Why waste memory? Share! Conventional transparent page sharing –Introduced by Disco –Idea: identify redundant page copies when created, map multiple guest physical pages to one same machine page –Shared pages are marked COW. Writing to a shared page causes a fault that generate a private copy –Requires guest OS modifications

Content-based Page Sharing Goal –No modification to guest OS or application interface Idea –Identify page copies by their contents –Pages with identical contents can be shared regardless of when, where, or how they were generated -- More opportunities for sharing Identify common pages – Hashing –Comparing each page with every other page: O(n^2) –A hash function compute a checksum of a page, which is used as a lookup key –Chaining is used to handle collisions Problem: when and where to scan? –Current implementation: randomly –More sophisticated approaches are possible

Hashing illustrated If hash value matches an existing entry, possible, but Perform a full comparison of page contents Once match identified, COW to share the page An unshared page is not marked COW, but tagged as a hint entry

Content-based Page Sharing Performance Space overhead: less than 0.5% of system memory Some sharing with ONE VM! Total amount of memory shared increases linearly with # of VMs Amount of memory needed to contain single copy remains nearly constant Little sharing is due to zero pages CPU overhead negligible. Aggregate throughput sometimes slightly higher with sharing enabled (locality) Best case workload Real world workload

Shares vs. Working Sets Memory allocation among VMs –Improve system-wide performance metric, or –Provide quality-of-service guarantees to clients of varying importance Conventional share-based allocation –Resource rights are encapsulated by shares –Resources are allocated proportional to the share –Problem Do not incorporate any information about active memory usage or working sets Idle clients with many shares can hoard memory unproductively, while active clients with few shares suffer under severe memory pressure

Idle Memory Taxation Goal –Achieve efficient memory utilization while maintaining memory performance isolation guarantees. Idea –Introducing an idle memory tax –Charge a client more for an idle page than for one it is actively using. When memory is scarce, pages will be reclaimed preferentially from clients that are not actively using their full allocations. –A tax rate specifies the maximum fraction of idle pages that may be reclaimed from a client –Using statistical sampling to obtain aggregate VM working set estimates directly

Idle Memory Taxation Performance Two VMs with identical share allocations, configured with 256MB in an overcommitted system. VM1 runs Windows, remains idle after booting VM2 runs Linux, executes a memory-intensive workload

Putting Things All Together Higher level memory management policies –Allocation parameters Min size: lower bound of amount of memory allocated to VM Max size: unless overcommited, VMs will be allocated max size Memory shares: fraction of physical memory –Admission control Ensures that sufficient unreserved memory and server swap space is available before a VM is allowed to power on Machine memory must be reserved for : min + overheads Disk swap space must be reserved for : max - min –Dynamic reallocation (in more details)

Dynamic Reallocation Recompute memory allocations in response to –Changes to system-wide or per-VM allocation parameters –Addition or removal of a VM to/from the system –Changes in the amount of free memory that cross predefined thresholds –Changes in idle memory estimates for each VM Four thresholds to reflect different reclamation states –High (6% of system memory) -- no reclamation performed –Soft (4% of system memory) -- ballooning (possibly paging) –Hard (2% of system memory) -- paging –Low (1% of system memory) -- continue paging, block execution of all VMs In all states, system computes target allocations for VMs to drive the aggregate amount of free space above the high threshold System transitions back to the next higher state only after significantly exceeding the higher threshold (to prevent rapid state fluctuations).

Dynamic reallocation Performance

Conclusions What was the goal? –Efficiently manage memory across virtual machines running unmodified commodity operating systems How they achieved it? –Ballooning technique for page reclaiming –Content-based transparent page sharing –Idle memory tax for share-based management –Higher level dynamic reallocation policy coordinates all the above Experiments were carefully designed and results are convincible and good