Multi-core Programming System Overview



Similar documents
Full and Para Virtualization

Introduction to Virtual Machines

Virtualization. Pradipta De

Virtualization for Cloud Computing

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtual Machines.

Virtualization. Types of Interfaces

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

x86 ISA Modifications to support Virtual Machines

Virtual Machines. Virtual Machines

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

Chapter 3 Operating-System Structures

COS 318: Operating Systems. Virtual Machine Monitors

Cloud Computing. Up until now

Distributed Systems. Virtualization. Paul Krzyzanowski

Chapter 14 Virtual Machines

Enabling Technologies for Distributed and Cloud Computing

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Operating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

Course Development of Programming for General-Purpose Multicore Processors

Cloud Computing CS

Enabling Technologies for Distributed Computing

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Chapter 2 System Structures

ELEC 377. Operating Systems. Week 1 Class 3

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

System Structures. Services Interface Structure

COM 444 Cloud Computing

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Virtual Machines. COMP 3361: Operating Systems I Winter

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

The Art of Virtualization with Free Software

Chapter 5 Cloud Resource Virtualization

Virtualization. Dr. Yingwu Zhu

Kernel comparison of OpenSolaris, Windows Vista and. Linux 2.6

PERFORMANCE ANALYSIS OF KERNEL-BASED VIRTUAL MACHINE

Operating System: Scheduling

Virtual Computing and VMWare. Module 4

12. Introduction to Virtual Machines

The MIPS architecture and virtualization

Restraining Execution Environments

Virtual Servers. Virtual machines. Virtualization. Design of IBM s VM. Virtual machine systems can give everyone the OS (and hardware) that they want.

IOS110. Virtualization 5/27/2014 1

CPET 581 Cloud Computing: Technologies and Enterprise IT Strategies. Virtualization of Clusters and Data Centers

Virtualization in the ARMv7 Architecture Lecture for the Embedded Systems Course CSD, University of Crete (May 20, 2014)

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

Virtualization and the U2 Databases

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Distributed and Cloud Computing

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Operating System Impact on SMT Architecture

Virtualization. Jia Rao Assistant Professor in CS

Cloud Architecture and Virtualisation. Lecture 4 Virtualisation

evm Virtualization Platform for Windows

Introduction to Engineering Using Robotics Experiments Lecture 18 Cloud Computing

Chapter 6, The Operating System Machine Level

Virtualization. Michael Tsai 2015/06/08

Data Centers and Cloud Computing

Basics of Virtualisation

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Virtual Machine Security

Virtualization. Jukka K. Nurminen

Why Threads Are A Bad Idea (for most purposes)

Multi-Threading Performance on Commodity Multi-Core Processors

Software and the Concurrency Revolution

Multi-core Curriculum Development at Georgia Tech: Experience and Future Steps

The Microsoft Windows Hypervisor High Level Architecture

HPC performance applications on Virtual Clusters


Security Overview of the Integrity Virtual Machines Architecture

nanohub.org An Overview of Virtualization Techniques

Hardware accelerated Virtualization in the ARM Cortex Processors

CHAPTER 1 INTRODUCTION

COS 318: Operating Systems. Virtual Machine Monitors

Topic 5a Operating System Fundamentals

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Virtualization for Hard Real-Time Applications Partition where you can Virtualize where you have to

Virtualization. Explain how today s virtualization movement is actually a reinvention

Virtual Machines. Adapted from J.S. Smith and R. Nair, VIRTUAL MACHINES, Morgan-Kaufmann Teodor Rus.

Virtualization: Hypervisors for Embedded and Safe Systems. Hanspeter Vogel Triadem Solutions AG

CPS221 Lecture: Operating System Structure; Virtual Machines

9/26/2011. What is Virtualization? What are the different types of virtualization.

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service

Lecture 25 Symbian OS

General Introduction

The XenServer Product Family:

Introduction to the NI Real-Time Hypervisor

CS550. Distributed Operating Systems (Advanced Operating Systems) Instructor: Xian-He Sun

Virtual Machines. Virtualization

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Multicore Programming with LabVIEW Technical Resource Guide

Android Architecture. Alexandra Harrison & Jake Saxton

Why Computers Are Getting Slower (and what we can do about it) Rik van Riel Sr. Software Engineer, Red Hat

Transcription:

Multi-core Programming System Overview Based on slides from Intel Software College and Multi-Core Programming increasing performance through software multi-threading by Shameem Akhter and Jason Roberts, Defining Threads Thread : discrete sequence of related instructions that is executed independently of other instruction sequences Every program has at least one thread main thread It can create other threads Each thread maintains a machine state OS maps software threads to hardware execution resources Too much threading can hurt performance 2 1

System View of Threads User-level Threads created in application software Kernel-level level Threads way OS implements threads Hardware Threads how threads appear to execution resources A program thread is implemented by OS as a kernel-level level thread and executed as a hardware thread 3 Threading above OS Can rely on run-time framework Known as managed code managed environments include Java Virtual Machine (JVM) and Microsoft s Common Language Runtime (CLR) Do not provide scheduling rely on OS If don t t then thread creation is call to system API executed as call to OS kernel to create thread figure shows thread flow in this case 4 2

APIs for Threading Common APIs OpenMP Ease of use More developer friendly implementation Requires compiler which supports C/C++ or Fortran Explicit low-level threads such as pthreads and Windows threads Requires significantly more code Give fine-grained control Only requires access to OS s libraries 5 Threading in OpenMP and pthreads Hello World OpenMP No explicit thread creation pthreads Thread created using pthread_create() 6 3

Threads inside OS Kernel maintains tables for processes and threads OpenMP and pthreads use Kernel level threads Windows supports both kernel and user level threads Kernel level more overhead but better performance Windows user-level threads (fibers) programmer must create management infrastructure and schedule threads manually 7 Processes Processes course level execution units Have own address space Processes can have multiple threads Threads share address space See same functions, data If one thread changes data, all see If one thread opens file, all can read from it Each thread has registers, stack, some other data Have simple inter-thread communication OS maintains a Process Control Block (PCB) for each process process identity, machine state, priority, address of virtual memory, file descriptors, user ID in kernel space requires system call (trap to OS) to access A thread table for all threads (not normally per process table) 8 4

Processes and Threads Memory is allocated to processes by the Memory Management Unit (MMU) Threads are mapped to CPUs by scheduler processor affinity enables user to request specific CPU for thread. Not guaranteed that OS will grant. 9 Thread to Processor Mapping 1:1 10 5

Thread to Processor Mapping M:1 11 Thread to Processor Mapping M:N 12 6

Thread to Processor Mapping 1:1 No thread-library scheduler overhead OS handles scheduling Called preemptive multi-threading Linux, Windows 2000, Windows XP use this Enables stronger handling of threads by OS We will concentrate on this model M:1 many to one thread-library scheduler decides which thread gets priority Called cooperative multi-threading 13 Difference between Concurrency and Parallelism Parallelism Chip Multithreading (CMT) multiprocessor, multicore Concurrency - Simultaneous Multithreading (SMT) hyperthreading For true parallelism program threads <= hardware threads Too many threads can slow performance 14 7

Thread Creation Each thread has own stack space Default thread stack size varies with OS Need to be aware of this 15 Thread States Ready Running Waiting (Blocked) Terminated Substates give reason for entering e.g. blocked on I/O etc 16 8

Virtual Environments Virtualization : creating the appearance of a different set of resources Runtime virtualization e.g. Java VM (JVM) or MS CLR Creates appearance Java appl running in private environment JVM is container and executor appl Create at least 3 threads for execution, garbage collection, justin-time (JIT) compilation Generally more threads for internal tasks System virtualization Creates appearance of virtual machine with own independent OS 17 System virtualization Complete virtual execution context virtualized NIC, disks, OS can be several VM on hardware Virtual Machine Monitor (VMM) or hypervisor intermediate layer 18 9

VMM role VMM gives each VM illusion owns hardware presents virtual processors (VP) to guest OS on VM Number equal to number of cores Creates isolation of instruction set architecture (ISA) What of privileged instruction? VMM and VM are applications cannot execute Priviliged insts are trapped by VM and call made to VMM VMM may be able to handle or may pass on to host OS, wait for response, emulate response in VM Performance cost to minimize Intel has provided extensions to ISA to allow VMM to efficiently execute priviliged insts Part of Intel Virtualization Technology 19 Mapping Application threads VMM does very little When VM creates threads, handled by guest OS When guest OS schedules thread, virtual processor executes VMM does not match appl threads to particular cores Only time VMM is involved is when swaps out a VM or performs internal tasks Can be issue when thread is locked and waiting for thread on virtual processor that is swapped out Thread has substantial delay problem known as lock-holder preemption One of problems that can arise in virtualization 20 10