CPUInheritance Scheduling. http://www.cs.utah.edu/projects/flux/ UniversityofUtah



Similar documents
OPERATING SYSTEMS SCHEDULING

CPU Scheduling. CPU Scheduling

W4118 Operating Systems. Instructor: Junfeng Yang

Operating Systems. III. Scheduling.

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

Processor Scheduling. Queues Recall OS maintains various queues

Operating Systems Concepts: Chapter 7: Scheduling Strategies

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

ICS Principles of Operating Systems

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Real-Time Scheduling 1 / 39

Chapter 5 Process Scheduling

OS OBJECTIVE QUESTIONS

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

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

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

CPU Scheduling Outline

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

Priority-Driven Scheduling

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads.

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

CS414 SP 2007 Assignment 1

4. Fixed-Priority Scheduling

Operating Systems Lecture #6: Process Management

<Insert Picture Here> An Experimental Model to Analyze OpenMP Applications for System Utilization

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

Operating System: Scheduling

Hard Real-Time Linux

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

Exercises : Real-time Scheduling analysis

Improvement of Scheduling Granularity for Deadline Scheduler

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

Operating System Aspects. Real-Time Systems. Resource Management Tasks

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Real- Time Scheduling

Comparison between scheduling algorithms in RTLinux and VxWorks

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

The Design and Implementation of Real-Time Schedulers in RED-Linux

CPU Scheduling. Core Definitions

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Chapter 2: OS Overview

Module 3: Instance Architecture Part 1

Enhancing the Monitoring of Real-Time Performance in Linux

Chapter 1 13 Essay Question Review

Operating Systems, 6 th ed. Test Bank Chapter 7


REAL TIME OPERATING SYSTEMS. Lesson-10:

Konzepte von Betriebssystem-Komponenten. Linux Scheduler. Valderine Kom Kenmegne Proseminar KVBK Linux Scheduler Valderine Kom

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Predictable response times in event-driven real-time systems

Linux 2.4. Linux. Windows

Introduction. Scheduling. Types of scheduling. The basics

Real-time KVM from the ground up

Java Mission Control

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Tasks Schedule Analysis in RTAI/Linux-GPL

Lecture 3 Theoretical Foundations of RTOS

Chapter 1 8 Essay Question Review

Modular Real-Time Linux

Threads Scheduling on Linux Operating Systems

Overview of the Linux Scheduler Framework

Implementing AUTOSAR Scheduling and Resource Management on an Embedded SMT Processor

Scheduling Algorithms

REDUCING TIME: SCHEDULING JOB. Nisha Yadav, Nikita Chhillar, Neha jaiswal

EECE 276 Embedded Systems

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

Zing Vision. Answering your toughest production Java performance questions

Running a Workflow on a PowerCenter Grid

Resource Aware Scheduler for Storm. Software Design Document. Date: 09/18/2015

ELEC 377. Operating Systems. Week 1 Class 3

Operating System Tutorial

PROGRAMMING CONCEPTS AND EMBEDDED PROGRAMMING IN C, C++ and JAVA: Lesson-4: Data Structures: Stacks

AFDX networks. Computers and Real-Time Group, University of Cantabria

How To Write A Multi Threaded Software On A Single Core (Or Multi Threaded) System

Quality of Service versus Fairness. Inelastic Applications. QoS Analogy: Surface Mail. How to Provide QoS?

High-Performance Automated Trading Network Architectures

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

LAB 5: Scheduling Algorithms for Embedded Systems

Programming real-time systems with C/C++ and POSIX

Linux scheduler history. We will be talking about the O(1) scheduler

<Insert Picture Here> Java Application Diagnostic Expert

Monitoring and Diagnosing Production Applications Using Oracle Application Diagnostics for Java. An Oracle White Paper December 2007

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

sndio OpenBSD audio & MIDI framework for music and desktop applications

SYSTEM ecos Embedded Configurable Operating System

ò Scheduling overview, key trade-offs, etc. ò O(1) scheduler older Linux scheduler ò Today: Completely Fair Scheduler (CFS) new hotness

SOFTWARE VERIFICATION RESEARCH CENTRE THE UNIVERSITY OF QUEENSLAND. Queensland 4072 Australia TECHNICAL REPORT. No Real-Time Scheduling Theory

Transcription:

CPUInheritance Scheduling DepartmentofComputerScience ComputerSystemsLaboratory BryanFord SaiSusarla http://www.cs.utah.edu/projects/flux/ UniversityofUtah October30,1996 flux@cs.utah.edu 1

KeyConcepts Threadsscheduleeachotherbydonatingthe Onerootschedulerthreadperprocessorsources CPUusingadirectedyieldprimitive. allcputime. Kerneldispatchermanagesthreads,events,and CPUdonationwithoutmakinganyscheduling policydecisions. 2

TheDispatcher Implementsthreadsleep,wakeup,schedule,etc. clocks,ortimers. Runsinthecontextofcurrentlyrunningthread. Hasnonotionofthreadpriority,CPUusage, Dispatcherwakesaschedulerthreadwhen: Eventofinteresttothescheduleroccurs. Scheduler'sclientblocks. 3

SchedulingExample Scheduler CPU Scheduler thread Ready queues CPU donation Port scheduling requests Running thread Ready threads App 1 Waiting thread App 2 4

Theschedule()operation Sensitivitylevels: schedule(thread,port,sensitivity) ONBLOCK:Wakethescheduleranytimeits ONSWITCH:Wakethescheduleronlywhena clientthreadblocks. ONCONFLICT:Wakethescheduleronlywhen dierentclientisrequestingthecpu. twoormoreclientsarerunnableatthe sametime. 5

ImplicitDonation e.g.: Workslikeschedule(),exceptdoneimplicitly; Threadattemptingtolockaheldmutex Clientthreaddonatestoserverthreadfor donatestocurrentowner Analogoustopriorityinheritanceintraditional thedurationofanrpc systems. CPU S0 6 T0 (high-priority) T1 (low-priority)

MultiprocessorScheduling Scheduler CPU 0 Scheduler threads Ready queues CPU 1 App 1 App 2 7

Benets Hierarchical,stackableschedulingpolicies Application-specicschedulingpolicies Automaticpriorityinheritance ModularCPUusagecontrol AccurateCPUusageaccounting Naturallyextendstomultiprocessors Supportsprocessoranitypolicies andscheduleractivations 8

PrototypeImplementation Implementedasafancythreadspackageina Schedulersimplemented: BSDprocess. Fixedpriorityround-robinandFIFO Ratemonotonic Lottery 9

SchedulingHierarchy Root Scheduler Fixed-priority Real-time Scheduler Rate-monotonic RM1 Real-time periodic threads Timesharing Class Lottery scheduling RM2 LS1 Web browser Lottery scheduling JAVA1 Java applet threads JAVA2 Background Round-robin RR1 RR2 FIFO Scheduler Non-preemptive FIFO1 Cooperating threads FIFO2 10

Results Threemeasures: Schedulingbehavior(correctness) Overhead Implementationcomplexity 11

Multi-policy Scheduling Behavior 2.5 2 1.5 1 0.5 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 Accumulated CPU usage (sec) Rate-monotonic thread 1 (50%) Rate monotonic thread 2 (25%) Lottery thread (Interactive - bursty) Round-robin thread 1 (Insatiable) Round-robin thread 2 (Insatiable) RM1 (50%) RR1 (compute) LS1 (burst) RR2 (compute) RM2 (25%) Time (clock ticks)

100 90 80 70 60 50 40 30 20 10 0 Modular Control of CPU Usage Applet thread 1 Applet thread 2 FIFO thread 1 FIFO thread 2 Round-robin thread 1 Round-robin thread 2 200 600 1000 1400 1800 2200 2600 3000 3400 3800 4200 4600 5000 5400 5800 6200 6600 7000 7400 7800 8200 8600 9000 9400 9800 Time (clock ticks) Relative CPU time allocation (percent)

Real-time Scheduling Behavior 70 60 CPU donation on mutex contention No CPU donation Number of occurrences 50 40 30 20 10 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Mutex lock latency for real-time thread (clock ticks)

Performance Dispatcheroverhead {Sensitivitytohierarchydepth {Basecost Contextswitchingoverhead {Numberofadditionalcontextswitches {Costofcontextswitches 15

SchedulingHierarchyDepthDispatchTime(s) DispatcherMicro-benchmarks Rootscheduleronly 2-levelscheduling 3-levelscheduling 4-levelscheduling 8-levelscheduling 11.2 14.0 16.2 24.4 8.0 16

Contextswitchoverhead Inprototype,measurewhatproportionof (i.e.,extra) contextswitchesaretoschedulerthreads OnarealOS,measurerateofcontext ProjectslowdownintwoOSs,basedonexpectedrateandspeedofcontextswitches switchesinvariousworkloads 17

ContextSwitchesforSimpleTests RM1 RM2 RM3 Client/ ServerDatabasetime 57 ParallelReal-General LS1 JAVA1 FIFO1 19 25 322 622 101 RR1 46 9 26 RR2 RR3 114 3 238 242 249 17 RR4 Userinvocations 492 234 243 9571193 165 147 Rootscheduler Ratemonotonic Lotteryscheduler Appletscheduler FIFOscheduler Round-robinsched 262 43 30 2 9561237 1 142 Schedulerinvoc. 18 8 3 Totalcsw Scheduler% 41% 346 838 19132496 50%52% 9561303 56% 218 383 8 18

StatisticsforCommon Applications Runtime(sec) Contextswitches/sec Traps/sec Systemcalls/sec 26.435.3 gzipgcc 11 32 tarconfigure Deviceinterrupts/sec4275093337 10562 23651 517 9.6 81 22 3470 1807 1055 26.0 202 19

10 8 Microkernel:configure (13000 csw/s) Microkernel:gcc (3500 csw/s) Microkernel:gzip (930 csw/s) FreeBSD:configure (202 csw/s) FreeBSD:gcc (32 csw/s) FreeBSD:gzip (11 csw/s) Overall slowdown (percent) 6 4 2 20 0 1 10 100 1000 Additional overhead per context switch (microsec)

CodeComplexity Dispatcher: Exampleschedulers: 550raw,160linesofsemicolons eachis100{200semicolons 21

RelatedWork Existingmulti-policysystems: Multi-classsystems:Mach,NT AegisExokernel 22

RelatedWork Existinghierarchicalschedulingpolicies: KeyKOSmeters Lottery/stridescheduling CPUinheritanceschedulingisnotapolicy. Start-timeFairQueuing(SFQ) 23

Status Works,butneedstobetriedinarealOS OSDIandFluxprojectwebpages: Sourceforprototypewillbeavailablefromthe Flukekernelimplementationinprogress http://www.cs.utah.edu/projects/flux/ 24

Conclusion CPUinheritancescheduling: ProvidesexibleCPUscheduling,andsupportsmanyexistingpoliciesandmechanisms Isecientenoughforcommonuses Isstraightforwardtoimplement(inuser SupportstheFlukenestedprocessmodel mode) 25