Multiprocessor Scheduling. Multiprocessor Scheduling

Similar documents
Multiprocessor Scheduling. Multiprocessor Scheduling

Multiprocessor Scheduling

Module 1: Virtualization. Types of Interfaces

Types of Virtualization. Types of virtualization

Lecture 5: February 3

Virtual Machine Monitors!

Operating Systems 4/27/2015

Chapter 5 C. Virtual machines

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

CSE 120 Principles of Operating Systems

CS370 Operating Systems

CHAPTER 16 - VIRTUAL MACHINES

Virtualization. Pradipta De

Nested Virtualization and Server Consolidation

Virtualization. ...or how adding another layer of abstraction is changing the world. CIS 399: Unix Skills University of Pennsylvania.

Virtual Machine Monitors (VMMs) are a hot topic in

Distributed Systems COMP 212. Lecture 18 Othon Michail

Virtual Machines. Part 2: starting 19 years ago. Operating Systems In Depth IX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

Virtualization. Michael Tsai 2018/4/16

Virtual Machines. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

COS 318: Operating Systems. Virtual Machine Monitors

The Challenges of X86 Hardware Virtualization. GCC- Virtualization: Rajeev Wankar 36

LINUX Virtualization. Running other code under LINUX

What is KVM? KVM patch. Modern hypervisors must do many things that are already done by OSs Scheduler, Memory management, I/O stacks

Virtualization. Virtualization

OS Virtualization. Linux Containers (LXC)

CLOUD COMPUTING IT0530. G.JEYA BHARATHI Asst.Prof.(O.G) Department of IT SRM University

COMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy

CS 350 Winter 2011 Current Topics: Virtual Machines + Solid State Drives

Virtualization and memory hierarchy

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Virtualization. ! Physical Hardware Processors, memory, chipset, I/O devices, etc. Resources often grossly underutilized

Virtualization. Starting Point: A Physical Machine. What is a Virtual Machine? Virtualization Properties. Types of Virtualization

Virtual Machines Disco and Xen (Lecture 10, cs262a) Ion Stoica & Ali Ghodsi UC Berkeley February 26, 2018

CHAPTER 16 - VIRTUAL MACHINES

Advanced Operating Systems (CS 202) Virtualization

Virtualization Introduction

Lecture 7. Xen and the Art of Virtualization. Paul Braham, Boris Dragovic, Keir Fraser et al. 16 November, Advanced Operating Systems

The Architecture of Virtual Machines Lecture for the Embedded Systems Course CSD, University of Crete (April 29, 2014)

Xen Project Status Ian Pratt 12/3/07 1

Virtualization. Operating Systems, 2016, Meni Adler, Danny Hendler & Amnon Meisels

for Kerrighed? February 1 st 2008 Kerrighed Summit, Paris Erich Focht NEC

EE 660: Computer Architecture Cloud Architecture: Virtualization

Server Virtualization Approaches

Introduction to Cloud Computing and Virtualization. Mayank Mishra Sujesha Sudevalayam PhD Students CSE, IIT Bombay

Overview of System Virtualization: The most powerful platform for program analysis and system security. Zhiqiang Lin

CS370 Operating Systems

Virtual Leverage: Server Consolidation in Open Source Environments. Margaret Lewis Commercial Software Strategist AMD

Virtualization. Dr. Yingwu Zhu

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

references Virtualization services Topics Virtualization

CprE Virtualization. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

I/O and virtualization

Virtualization. join, aggregation, concatenation, array, N 1 ühendamine, agregeerimine, konkateneerimine, massiiv

CSC 5930/9010 Cloud S & P: Virtualization

Knut Omang Ifi/Oracle 6 Nov, 2017

Background. IBM sold expensive mainframes to large organizations. Monitor sits between one or more OSes and HW

VIRTUALIZATION: IBM VM/370 AND XEN

CS370: Operating Systems [Spring 2016] Dept. Of Computer Science, Colorado State University

Cloud Computing Virtualization

Operating Systems, Fall Lecture 9, Tiina Niklander 1


Unit 5: Distributed, Real-Time, and Multimedia Systems

NON SCHOLAE, SED VITAE

Xen and the Art of Virtualization. CSE-291 (Cloud Computing) Fall 2016

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

A Survey on Virtualization Technologies

OS Virtualization. Why Virtualize? Introduction. Virtualization Basics 12/10/2012. Motivation. Types of Virtualization.

Lecture 09: VMs and VCS head in the clouds

CSCI 8530 Advanced Operating Systems. Part 19 Virtualization

Virtualisation: The KVM Way. Amit Shah

Multiprocessor Systems Continuous need for faster computers Multiprocessors: shared memory model, access time nanosec (ns) Multicomputers: message pas

Virtualization (II) SPD Course 17/03/2010 Massimo Coppola

CS-580K/480K Advanced Topics in Cloud Computing. VM Virtualization II

CS 571 Operating Systems. Final Review. Angelos Stavrou, George Mason University

DISCO and Virtualization

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

System Virtual Machines

INNOV-4: Fun With Virtualization. Or, How I learned to love computers that don t really exist...

Learning Outcomes. Extended OS. Observations Operating systems provide well defined interfaces. Virtual Machines. Interface Levels

OPS-9: Fun With Virtualization. John Harlow. John Harlow. About John Harlow

Linux and Xen. Andrea Sarro. andrea.sarro(at)quadrics.it. Linux Kernel Hacking Free Course IV Edition

Introduction to Virtual Machines. Carl Waldspurger (SB SM 89 PhD 95) VMware R&D

The Future of Virtualization

SUSE An introduction...

Xen and the Art of Virtualization. Nikola Gvozdiev Georgian Mihaila

Originally prepared by Lehigh graduate Greg Bosch; last modified April 2016 by B. Davison

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Performance & Scalability Testing in Virtual Environment Hemant Gaidhani, Senior Technical Marketing Manager, VMware

Virtualization, Xen and Denali

CS 326: Operating Systems. CPU Scheduling. Lecture 6

Πποχωπημένη Κατανεμημένη Υπολογιστική

Using MySQL in a Virtualized Environment. Scott Seighman Systems Engineer Sun Microsystems

Virtual Virtual Memory

How it can help your organisation

MANAGEMENT OF TASKS IN VIRTUALIZED ENVIRONMENTS

What is Cloud Computing? Cloud computing is the dynamic delivery of IT resources and capabilities as a Service over the Internet.

CSCE 410/611: Virtualization

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

Transcription:

Multiprocessor Scheduling Will consider only shared memory multiprocessor or multi-core CPU Salient features: One or more caches: cache affinity is important Semaphores/locks typically implemented as spin-locks: preemption during critical sections Multi-core systems: some caches shared (L2,L3); others are not Lecture 4, page 1 Multiprocessor Scheduling Central queue queue can be a bottleneck Distributed queue load balancing between queue Lecture 4, page 2

Multiprocessor Scheduling Common mechanisms combine central queue with per processor queue (SGI IRIX) Exploit cache affinity try to schedule on the same processor that a process/thread executed last Context switch overhead Quantum sizes larger on multiprocessors than uniprocessors Lecture 4, page 3 Parallel Applications on SMPs Gang scheduling: schedule parallel app at once Effect of spin-locks: what happens if preemption occurs in the middle of a critical section? Preempt entire application (co-scheduling) Raise priority so preemption does not occur (smart scheduling) Both of the above Provide applications with more control over its scheduling Users should not have to check if it is safe to make certain system calls If one thread blocks, others must be able to run Lecture 4, page 4

Distributed Scheduling: Motivation Distributed system with N workstations Model each w/s as identical, independent M/M/1 systems Utilization u, P(system idle)=1-u What is the probability that at least one system is idle and one job is waiting? Lecture 4, page 5 Implications Probability high for moderate system utilization Potential for performance improvement via load distribution High utilization => little benefit Low utilization => rarely job waiting Distributed scheduling (aka load balancing) potentially useful What is the performance metric? Mean response time What is the measure of load? Must be easy to measure Must reflect performance improvement Lecture 4, page 6

Design Issues Measure of load Queue lengths at CPU, CPU utilization Types of policies Static: decisions hardwired into system Dynamic: uses load information Adaptive: policy varies according to load Preemptive versus non-preemptive Centralized versus decentralized Stability: λ>µ => instability, λ 1 +λ 2 <µ 1 +µ 2 =>load balance Job floats around and load oscillates Lecture 4, page 7 Components Transfer policy: when to transfer a process? Threshold-based policies are common and easy Selection policy: which process to transfer? Prefer new processes Transfer cost should be small compared to execution cost Select processes with long execution times Location policy: where to transfer the process? Polling, random, nearest neighbor Information policy: when and from where? Demand driven [only if sender/receiver], time-driven [periodic], state-change-driven [send update if load changes] Lecture 4, page 8

Sender-initiated Policy Transfer policy Selection policy: newly arrived process Location policy: three variations Random: may generate lots of transfers => limit max transfers Threshold: probe n nodes sequentially Transfer to first node below threshold, if none, keep job Shortest: poll N p nodes in parallel Choose least loaded node below T Lecture 4, page 9 Receiver-initiated Policy Transfer policy: If departing process causes load < T, find a process from elsewhere Selection policy: newly arrived or partially executed process Location policy: Threshold: probe up to N p other nodes sequentially Transfer from first one above threshold, if none, do nothing Shortest: poll n nodes in parallel, choose node with heaviest load above T Lecture 4, page 10

Symmetric Policies Nodes act as both senders and receivers: combine previous two policies without change Use average load as threshold Improved symmetric policy: exploit polling information Two thresholds: LT, UT, LT <= UT Maintain sender, receiver and OK nodes using polling info Sender: poll first node on receiver list Receiver: poll first node on sender list Lecture 4, page 11 Case Study 1 : V-System (Stanford) State-change driven information policy Significant change in CPU/memory utilization is broadcast to all other nodes M least loaded nodes are receivers, others are senders Sender-initiated with new job selection policy Location policy: probe random receiver, if still receiver, transfer job, else try another Lecture 4, page 12

Case study 2: Sprite (Berkeley) Workstation environment => owner is king! Centralized information policy: coordinator keeps info State-change driven information policy Receiver: workstation with no keyboard/mouse activity for 30 seconds and # active processes < number of processors Selection policy: manually done by user => workstation becomes sender Location policy: sender queries coordinator WS with foreign process becomes sender if user becomes active: selection policy=> home workstation Lecture 4, page 13 Sprite (contd) Sprite process migration Facilitated by the Sprite file system State transfer Swap everything out Send page tables and file descriptors to receiver Demand page process in Only dependencies are communication-related Redirect communication from home WS to receiver Lecture 4, page 14

Case Study 3 : Volunteer Computing Internet scale operating system (ISOS) Harness compute cycles of thousands of PCs on the Internet PCs owned by different individuals Donate CPU cycles/storage when not in use (pool resouces) Contact coordinator for work Coordinator: partition large parallel app into small tasks Assign compute/storage tasks to PCs Examples: Seti@home, BOINC, P2P backups Volunteer computing Lecture 4, page 15 Case study 4 : Condor Condor: use idle cycles on workstations in a LAN Used to run large batch jobs, long simulations Idle machines contact condor for work Condor assigns a waiting job User returns to workstation => suspend job, migrate supports process migration Flexible job scheduling policies Sun Grid Engine: similar features as Condor Evolved into cluster batch schedulers (SGE, DQS ) Lecture 4, page 16

Virtualization Virtualization: extend or replace an existing interface to mimic the behavior of another system. Introduced in 1970s: run legacy software on newer mainframe hardware Handle platform diversity by running apps in VMs Portability and flexibility Lecture 4, page 17 Types of Interfaces Different types of interfaces Assembly instructions System calls APIs Depending on what is replaced /mimiced, we obtain different forms of virtualization Lecture 4, page 18

Types of Virtualization Emulation VM emulates/simulates complete hardware Unmodified guest OS for a different PC can be run Bochs, VirtualPC for Mac, QEMU Full/native Virtualization VM simulates enough hardware to allow an unmodified guest OS to be run in isolation Same hardware CPU IBM VM family, VMWare Workstation, Parallels, VirtualBox Lecture 4, page 19 Types of virtualization Para-virtualization VM does not simulate hardware Use special API that a modified guest OS must use Hypercalls trapped by the Hypervisor and serviced Xen, VMWare ESX Server OS-level virtualization OS allows multiple secure virtual servers to be run Guest OS is the same as the host OS, but appears isolated apps see an isolated OS Solaris Containers, BSD Jails, Linux Vserver, Linux containers, Docker Application level virtualization Application is gives its own copy of components that are not shared (E.g., own registry files, global objects) - VE prevents conflicts JVM, Rosetta on Mac (also emulation), WINE Lecture 4, page 20

Types of Hypervisors Type 1: hypervisor runs on bare metal Type 2: hypervisor runs on a host OS Guest OS runs inside hypervisor Both VM types act like real hardware Lecture 4, page 21 How Virtualization works? CPU supports kernel and user mode (ring0, ring3) Set of instructions that can only be executed in kernel mode I/O, change MMU settings etc -- sensitive instructions Privileged instructions: cause a trap when executed in kernel mode Result: type 1 virtualization feasible if sensitive instruction subset of privileged instructions Intel 386: ignores sensitive instructions in user mode Can not support type 1 virtualization Recent Intel/AMD CPUs have hardware support Intel VT, AMD SVM Create containers where a VM and guest can run Hypervisor uses hardware bitmap to specify which inst should trap Sensitive inst in guest traps to hypervisor Lecture 4, page 22

Type 1 hypervisor Unmodified OS is running in user mode (or ring 1) But it thinks it is running in kernel mode (virtual kernel mode) privileged instructions trap; sensitive inst-> use VT to trap Hypervisor is the real kernel Upon trap, executes privileged operations Or emulates what the hardware would do Lecture 4, page 23 Type 2 Hypervisor VMWare example Upon loading program: scans code for basic blocks If sensitive instructions, replace by Vmware procedure Binary translation Cache modified basic block in VMWare cache Execute; load next basic block etc. Type 2 hypervisors work without VT support Sensitive instructions replaced by procedures that emulate them. Lecture 4, page 24

Paravirtualization Both type 1 and 2 hypervisors work on unmodified OS Paravirtualization: modify OS kernel to replace all sensitive instructions with hypercalls OS behaves like a user program making system calls Hypervisor executes the privileged operation invoked by hypercall. Lecture 4, page 25 Virtual machine Interface Standardize the VM interface so kernel can run on bare hardware or any hypervisor Lecture 4, page 26

Memory virtualization OS manages page tables Create new pagetable is sensitive -> traps to hypervisor hypervisor manages multiple OS Need a second shadow page table OS: VM virtual pages to VM s physical pages Hypervisor maps to actual page in shadow page table Two level mapping Need to catch changes to page table (not privileged) Change PT to read-only - page fault Paravirtualized - use hypercalls to inform Lecture 4, page 27 I/O Virtualization Each guest OS thinks it owns the disk Hypervisor creates virtual disks Large empty files on the physical disk that appear as disks to the guest OS Hypervisor converts block # to file offset for I/O DMA need physical addresses Hypervisor needs to translate Lecture 4, page 28

Examples Application-level virtualization: process virtual machine VMM /hypervisor Lecture 4, page 29 Virtual Appliances & Multi-Core Virtual appliance: pre-configured VM with OS/ apps pre-installed Just download and run (no need to install/comfigure) Software distribution using appliances Multi-core CPUs Run multiple VMs on multi-core systems Each VM assigned one or more vcpu Mapping from vcpus to physical CPUs Lecture 4, page 30

Use of Virtualization Today Data centers: server consolidation: pack multiple virtual servers onto a smaller number of physical server saves hardware costs, power and cooling costs Cloud computing: rent virtual servers cloud provider controls physical machines and mapping of virtual servers to physical hosts User gets root access on virtual server Desktop computing: Multi-platform software development Testing machines Run apps from another platform Lecture 4, page 31 Case Study: PlanetLab Distributed cluster across universities Used for experimental research by students and faculty in networking and distributed systems Uses a virtualized architecture Linux Vservers Node manager per machine Obtain a slice for an experiment: slice creation service Lecture 4, page 32