Redesigning Xen Memory Sharing (Grant) Mechanism Kaushik Kumar Ram (Rice University) Jose Renato Santos (HP Labs) Yoshio Turner (HP Labs) Alan L. Cox (Rice.

Slides:



Advertisements
Similar presentations
Virtual Trunk Protocol
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
1 Building a Fast, Virtualized Data Plane with Programmable Hardware Bilal Anwer Nick Feamster.
UNITED NATIONS Shipment Details Report – January 2006.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
ZMQS ZMQS
Chapter 1 Introduction Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Introduction Abstract Views of an Operating System.
Communicating over the Network
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
SE-292 High Performance Computing
1 Peripheral Component Interconnect (PCI). 2 PCI based System.
Chapter 5 : Memory Management
Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Diagnosing Performance Overheads in the Xen Virtual Machine Environment Aravind Menon Willy Zwaenepoel EPFL, Lausanne Jose Renato Santos Yoshio Turner.
Chapter 1: Introduction to Scaling Networks
EU market situation for eggs and poultry Management Committee 20 October 2011.
Project 5: Virtual Memory
Hardware-assisted Virtualization
Chapter 10: Virtual Memory
2 |SharePoint Saturday New York City
Operating Systems Operating Systems - Winter 2011 Dr. Melanie Rieback Design and Implementation.
Operating Systems Operating Systems - Winter 2012 Dr. Melanie Rieback Design and Implementation.
VOORBLAD.
15. Oktober Oktober Oktober 2012.
Making Time-stepped Applications Tick in the Cloud Tao Zou, Guozhang Wang, Marcos Vaz Salles*, David Bindel, Alan Demers, Johannes Gehrke, Walker White.
Virtual Switching Without a Hypervisor for a More Secure Cloud Xin Jin Princeton University Joint work with Eric Keller(UPenn) and Jennifer Rexford(Princeton)
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Defect Tolerance for Yield Enhancement of FPGA Interconnect Using Fine-grain and Coarse-grain Redundancy Anthony J. YuGuy G.F. Lemieux September 15, 2005.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
KAIST Computer Architecture Lab. The Effect of Multi-core on HPC Applications in Virtualized Systems Jaeung Han¹, Jeongseob Ahn¹, Changdae Kim¹, Youngjin.
25 seconds left…...
Januar MDMDFSSMDMDFSSS
SE-292 High Performance Computing
Breaking Up is Hard to Do Security and Functionality in a Commodity Hypervisor 1 Patrick Colp†, Mihir Nanavati†, Jun Zhu‡ William Aiello†, George Coker*,
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
Xen and the Art of Virtualization. Introduction  Challenges to build virtual machines Performance isolation  Scheduling priority  Memory demand  Network.
© 2008 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Achieving 10 Gb/s Using Xen Para-virtualized.
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
Penn State CSE “Optimizing Network Virtualization in Xen” Aravind Menon, Alan L. Cox, Willy Zwaenepoel Presented by : Arjun R. Nath.
CS533 Concepts of Operating Systems Jonathan Walpole.
Full and Para Virtualization
Xen Network I/O Performance Analysis and Opportunities for Improvement
Presentation transcript:

Redesigning Xen Memory Sharing (Grant) Mechanism Kaushik Kumar Ram (Rice University) Jose Renato Santos (HP Labs) Yoshio Turner (HP Labs) Alan L. Cox (Rice University) Scott Rixner (Rice University) Xen Summit Aug 2 nd 2011

This talk… Will make a case for redesigning the grant mechanism to achieve better I/O performance and for other benefits Will propose an alternate design for the grant mechanism Will present an evaluation of a prototype of this new design 8/2/11 1 Xen Summit 2011

Outline Motivation Proposal A grant reuse scheme Evaluation Conclusion 8/2/11 2 Xen Summit 2011

Traditional I/O Virtualization Driver Domain Guest Domain backend frontend Xen Hypervisor Physical Driver Hardware Device Guest domain – driver domain memory sharing (grant mechanism) Driver domain – device memory sharing (IOMMU) Two level memory sharing 8/2/11 3 Xen Summit 2011

Direct Device Assignment Guest Domain Xen Hypervisor Physical Driver Hardware Device Guest domain – device memory sharing (IOMMU) One level memory sharing 8/2/11 4 Xen Summit 2011

Grant Mechanism Controlled memory sharing between domains Source domain can share its memory pages with a specific destination domain Destination domain can validate that the shared pages belong to the source domain via the hypervisor 8/2/11 5 Xen Summit 2011

Creating Shared Memory using Grant Mechanism Source Domain Creates grant entry in grant table Destination Domain Issues grant hypercall Hypervisor validates grant and maps source page Destination Domain Source Domain Xen Hypervisor Hardware Grant Table Hypercall grant reference 8/2/11 6 Xen Summit 2011

Revoking Shared Memory using Grant Mechanism Destination Domain Issues grant hypercall Hypervisor unmaps page Source Domain Deletes grant entry from grant table Destination Domain Source Domain Xen Hypervisor Hardware Grant Table Hypercall 8/2/11 7 Xen Summit 2011

IOMMU To safely share memory with I/O devices Maintain memory isolation between domains (direct device assignment) Protect against device driver bugs Protect against attacks exploiting device DMA I/O Device Memory IOMMU Table I/O Address Machine Address 8/2/11 8 Xen Summit 2011

Sharing Memory via IOMMUs Para-virtualized I/O :- Fine-grained sharing IOMMU mapping setup during grant map hypercall and revoked during grant unmap hypercall Direct Device Assignment :- Only coarse-grained sharing 8/2/11 9 Xen Summit 2011

High Memory Sharing Overhead I/O page is shared only for the duration of a single I/O High cost of grant hypercalls and mapping/unmapping incurred in driver domain on every I/O operation 8/2/11 10 Xen Summit 2011

Reuse Scheme to Reduce Overhead Take advantage of temporal and/or spatial locality in use of I/O pages Reuse grants when I/O pages are reused Reduce grant issue and revoke operations Reduce grant hypercalls and mapping/unmapping overheads in driver domain 8/2/11 11 Xen Summit 2011

Reuse Under Existing Grant Mechanism Grant reuse scheme requires – Not revoking grants after every I/O operation Persistent mapping of guest I/O pages in driver domain Grants can be revoked when pages re-purposed for non-I/O operations Today, there exists no way for guest domain to revoke access when its page is still mapped in driver domain 8/2/11 12 Xen Summit 2011

Goals Enable reuse to reduce memory sharing related overheads during I/O Support unilateral revocation of grants by source domains Support an unified interface to share memory with I/O devices via IOMMUs 8/2/11 13 Xen Summit 2011

Proposal Move the grant related hypercalls to the guest domains Guest domains directly interact with the hypervisor to issue and revoke grants Driver Domain Guest Domain Xen Hypervisor Hardware Hypercall Grant Table 8/2/11 14 Xen Summit 2011

Redesigned Grant Mechanism 1. Initialization INIT1 hypercall (para- virtualized I/O only) Registers a virtual address range Base address(es) and size INIT2 hypercall Provides a device_id Returns the size of the grant address space 0 – size of address range Driver Domain Guest Domain Xen Hypervisor Hardware INIT2 Hypercall INIT1 Hypercall 8/2/11 15 Xen Summit 2011

Grant (I/O) Address Space 8/2/11Xen Summit Grant address space Driver domain virtual address space (page table) I/O virtual address space (IOMMU table) Size of address range 0x x0 0x x x10000

Redesigned Grant Mechanism 2. Creating Shared Memory Guest Domain : Picks a grant reference Offset within grant address space Issues grant MAP hypercall Hypervisor validates grant and maps guest page Driver Domain : Translates grant reference into virtual address and I/O address Driver Domain Guest Domain Xen Hypervisor MAP Hypercall grant reference Hardware Setup IOMMU mapping 8/2/11 17 Xen Summit 2011

Grant Mapping 8/2/11Xen Summit Grant address space Driver domain virtual address space (page table) I/O virtual address space (IOMMU table) 0x x0 0x x x10000 Grant reference 0x7000

Redesigned Grant Mechanism 2. Creating Shared Memory Guest Domain : Picks a grant reference Offset within grant address space Issues grant MAP hypercall Hypervisor validates grant and maps guest page Driver Domain : Translates grant reference into virtual address and I/O address Driver Domain Guest Domain Xen Hypervisor MAP Hypercall grant reference Hardware Setup IOMMU mapping 8/2/11 19 Xen Summit 2011

Grant Mapping 8/2/11Xen Summit Grant address space Driver domain virtual address space (page table) I/O virtual address space (IOMMU table) 0x x0 0x x x10000 Grant reference 0x x17000

Redesigned Grant Mechanism 3. Revoking Shared Memory Guest Domain : Issues grant UNMAP hypercall Provides grant reference Hypervisor unmaps page Driver Domain Guest Domain Xen Hypervisor Hardware UNMAP Hypercall Remove IOMMU mapping 8/2/11 21 Xen Summit 2011

Unilateral Revocation Guest domains can revoke grants any time by issuing grant UNMAP hypercall No driver domain participation required Safe to revoke grants even when the I/O pages are in use Since corresponding IOMMU mappings are also removed 8/2/11 22 Xen Summit 2011

Unified Interface Grant hypercall interface can be invoked from the Guest DMA library netfront SRIOV VF Driver DMA Library Xen Hypervisor Hardware IOMMU Guest Domain 8/2/11 23 Xen Summit 2011

Grant Reuse Take advantage of temporal and/or spatial locality in use of I/O pages Reuse grants when I/O pages are reused Reuse grants across multiple I/O operations Guest domain issues grant Driver domain uses I/O page for multiple I/O operations Guest domain revokes grant Guest domains can implement any scheme to reuse grants Relax safety constraints Security vs performance trade-off Shared mappings, delayed invalidations, optimistic tear-down etc. 8/2/11 24 Xen Summit 2011

A Grant Reuse Scheme Security compromise – prevents corruption of non-I/O pages Policy – Never share a non-I/O read-write page Receive read-write sharing Allocate I/O buffers from a dedicated pool E.g. slab cache in Linux Revoke grant when pages are reaped from pool I/O buffer pool also promotes temporal locality Transmit read-only sharing Persistent sharing Grants revoked only when there are no more grant references available (or keep it mapped always) 8/2/11 25 Xen Summit 2011

Evaluation - Setup and Methodology Server Configuration HP Proliant BL460c G7 Blade server Intel Xeon X5670 – 6 CPU cores 32 GB RAM 2 embedded 10 GbE ports Domain Configuration Domain0 linux pvops kernel and 1 GB memory Driver Domain linux xen0 (modified) and 512 MB memory Guest Domains linux xenU (modified) and 512 MB memory Driver and guest domains configured with one VCPU each (pinned) Netperf TCP Streaming tests 8/2/11 26 Xen Summit 2011

Evaluation - Transmit Results 8/2/11 27 Xen Summit 2011 mapcount() logic significantly affects performance (baseline with IOMMU)

Evaluation - Receive Results 8/2/11 28 Xen Summit 2011 No IOMMU overhead during RX Driver domain bottleneck (Baseline)

Evaluation – Inter-guest Results 8/2/11 29 Xen Summit 2011 Driver domain bottleneck (Baseline)

Discussion Supporting multiple mappings in driver domain (e.g. block tap interface) Driver domain can register address ranges from multiple address spaces Or use hardware-assisted memory virtualization Cannot support unilateral revocation without IOMMUs Cannot revoke grants to in-use pages 8/2/11 30 Xen Summit 2011

Conclusions Made a case for redesigning the grant mechanism Enable grant reuse Support unilateral revocations Support an unified interface to program IOMMUs Proposed an alternate design where the source domain interacts directly with the hypervisor Implemented and evaluated a reuse scheme 8/2/11 31 Xen Summit 2011