CS 414 - Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.

Slides:



Advertisements
Similar presentations
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Advertisements

CS 149: Operating Systems February 3 Class Meeting
OS, , Part II CPU Scheduling Department of Computer Engineering, PSUWannarat Suntiamorntut.
CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
CPE555A: Real-Time Embedded Systems
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
CPU SCHEDULING RONG ZHENG. OVERVIEW Why scheduling? Non-preemptive vs Preemptive policies FCFS, SJF, Round robin, multilevel queues with feedback, guaranteed.
Chapter 3: CPU Scheduling
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Scheduling in Batch Systems
Project 2 – solution code
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Chapter 5: CPU Scheduling
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
CPU Scheduling Basic Concepts Scheduling Criteria
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
CS3530 OPERATING SYSTEMS Summer 2014 Processor Scheduling Chapter 5.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
More Scheduling cs550 Operating Systems David Monismith.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Fair Resource Access & Allocation  OS Scheduling
Page 19/18/2015 CSE 40373/60373: Multimedia Systems Resources Classification  Resource is a system entity required by tasks for manipulating data  Active.
Page 110/9/2015 CSE 40373/60373: Multimedia Systems So far…  RMS - task with highest rate has highest priority  EDF – earliest deadline first  Tasks.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 31 – Multimedia OS (Part 1) Klara Nahrstedt Spring 2011.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
CS333 Intro to Operating Systems Jonathan Walpole.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Operating Systems Unit 5: – Processor scheduling – Java – Linux – Windows XP Operating Systems.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Scheduling.
Chapter 6: CPU Scheduling (Cont’d)
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Chapter 5a: CPU Scheduling
Networks and Operating Systems: Exercise Session 2
Klara Nahrstedt Spring 2011
Chapter 8 – Processor Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Operating System Concepts
TDC 311 Process Scheduling.
CPU SCHEDULING.
Chapter 6: CPU Scheduling
Lecture 21: Introduction to Process Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Presentation transcript:

CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010

Administrative MP4 is out, Start early Competition on May 3, 2010, 5-6:30pm in 216 SC Deadline of MP4 for grading – Saturday, May 1, 3-5pm in 216 SC (pre-competition to decide on the finalists) All should come, pizza and 1,2,3 rd prices of the competition will be provided between 6:30-7pm on May 3 CS Spring 2010

CPU Process/Thread Scheduling Maintain many programs in memory Determine how to best schedule them Requires information about the processes and an understanding of the system goals Switch among processes rapidly so each user perceives direct ownership of system CS Spring 2010

CPU Scheduling Evaluation Criteria Throughput: processes completed per unit time Turnaround: from submission to termination Wait: time waiting in the ready queue Response: from user request to system response Utilization: how busy the CPU is over time Want predictable system behavior CS Spring 2010

Scheduling Algorithms FCFS Shortest Job First Priority scheduling Round-robin Multi-level queue Rate monotonic Earliest deadline first For General Purpose Process CPU Scheduling For RT/Multimedia Process CPU Scheduling CS Spring 2010

Real-time/Multimedia Processing Requirements Need to process continuous multimedia data  Processing occurs in predetermined, usually periodic intervals  Processing must be completed by certain deadlines Need RT process manager  Perform admission control  Determine schedule  Perform reservation  Schedule to give processing guarantees CS Spring 2010

RT/Multimedia Processing Requirements Main Problem: How to find a feasible schedule? Conflicting Goals/Problems: How do we schedule multimedia (RT) processes so that 1. non-RT processes do not starve when RT process is running 2. RT process is not subject to priority inversion CS Spring 2010

Model in RT Scheduling Task (Process) – schedulable unit Task characterized by  Timing constraints  Resource requirements Assumptions  Periodic tasks without precedence relations Time constraints  s – task starting point  e – task processing time  d – task deadline  p – task period CS Spring 2010

Periodic Constant Processing Time Tasks Example Usage Pattern: Peak Processing Time=10ms Period = 100ms Time(ms) CS Spring 2010

Periodic Variable Processing Time Tasks Example Usage Pattern: Period = 100ms Peak Processing Time = 30ms Sustainable Processing Time = 15ms Burst Tolerance = 7ms Time(ms) CS Spring 2010

Model of RT Scheduling Congestion avoidance deadline  If period at (k-1) step is equal to ready (start) time of period k Tasks: preemptive vs. non-preemptive Main goal of RT Scheduling:  find feasible schedule of all periodic tasks so that newly arriving task and all previous admitted tasks finish processing in every period according to their deadline CS Spring 2010

Model of RT Scheduling Must have Schedulability (Admission) Test for RT tasks What is the performance metric for RT tasks?  Guarantee ratio := number of guaranteed tasks/total number of tasks  Process utilization (U): CS Spring 2010

Scheduling Policies of RT Tasks Rate- Monotonic Scheduling (RMS)  Designed/proved by C.L. Liu and Layland 1973  Policy: task with highest rate has highest priority  Static and optimal, priority-driven Optimal means that there no other static algorithm that is able to schedule a RT task which can’t be scheduled by RMS algorithm Assumptions:  Tasks are periodic  Each task must complete before next request  All tasks are independent  Run-time of each task request is constant  Any non-periodic task has no required deadline CS Spring 2010

Example of RMS CS Spring 2010

Scheduling Policies for RT Tasks Earliest Deadline First (EDF) Policy  Optimal dynamic algorithm  Produces valid schedule if one exists  Complexity O(n 2 )  Upper bound of process utilization 100%  Policy: task with earliest deadline has highest priority CS Spring 2010

Example of EDF CS Spring 2010

Comparison between RMS and EDF CS Spring 2010

Admission Control (for preemptive tasks) Schedulability test for RMS Schedulability test for EDF CS Spring 2010

Example Consider the following preemptive RT tasks and their characteristics  T1: p1 = 50ms, e1=10ms  T2: p2 = 100ms, e2=20ms  T3: p3 = 200ms, e3=50ms  T4: p4 = 100ms, e4=20ms Are these tasks schedulable via RMS?  If yes, what is the feasible schedule? Are these tasks schedulable via EDF?  If yes, what is the feasible schedule? CS Spring 2010

Example of Multimedia Process Management System (DSRT) - Execution Flow of a SRT Process Probe Admission Control Monitor/ Conformance Test Probing Phase Reservation Phase Execution Phase Adaptation Extract Reservation Contract Processor Binding Adjusted Contract SRT Process Scheduling CS Spring 2010

Multiprocessor Partitioning Design Guaranteed PartNon-guaranteed Part PCPT Processes PVPT Processes RT SchedulerOverrun SchedulerTS Scheduler TS Processes Reserved RunOverrun BurstReserved RunOverrun Processor #1 Processor #2 RT PartitionOverrun PartitionTS Partition RT PartitionOverrun PartitionTS Partition CS Spring 2010

Partition Scheduling RT SchedulerOverrun SchedulerTS Scheduler Processor #1 Processor #2 RT PartitionOverrun PartitionTS Partition RT PartitionOverrun PartitionTS Partition Top-Level Scheduler Preemptive EDF Multi-Level Round Robin Priority Queues Kernel Scheduler Proportional Sharing CS Spring 2010

RT Partition Scheduler Waiting Queue: (Sorted with the earliest released time) Processor #1 p p p Runnable Queue: (Sorted with the earliest deadline) (1) admitted (2a) finished one iteration (2b) overrunning (3) released for next iteration Overrun Partition Queues CS Spring 2010

Overrun Partition Scheduler Burst Queue (FIFO) Overrun Queue (FIFO) Permanent Non-conforming Queue (FIFO) p (1a) Conformed? (1b) Nonconformed? (1c) Nonconformed frequently? p (2) Miss Deadline Lowest Priority Highest Priority CS Spring 2010

How to Implement SRT in Best Effort Linux (User-level Priority Dispatch) DSRT Scheduler Process Dispatched Process (3) Scheduler sets Timer for T ms. (1) Increase Priority. (2) Set Processor Affinity. (5) Decrease Priority Highest Priority Lowest Priority Time Sharing Processes RT Process Pool Fixed RT Priority Dynamic TS Priority (4) Scheduler sleeps. (5) Dispatched Process runs for T ms. (6) Timer interrupts Scheduler N N CS Spring 2010

Experimental Result SRT1: MPEG player With P=100ms SRT2: MPEG player with P=50ms. CS Spring 2010

Conclusion RMS and EDF are basic policies for real- time scheduling systems For multimedia systems, soft-real-time scheduling (SRT) concepts needed, connecting reservation-based and adaption-based SRT DSRT system shows implementation of multimedia SRT systems CS Spring 2010