1 Course Matters. NUS.SOC.CS5248 OOI WEI TSANG 2 Paper Review October 2003 MonTueWedThuFriSatSun 171819 20212223242526 Paper Reviews Due 20% off for each.

Slides:



Advertisements
Similar presentations
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
Advertisements

CPE555A: Real-Time Embedded Systems
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
Real-time concepts Lin Zhong ELEC424, Fall Real time Correctness – Logical correctness – Timing Hard vs. Soft – Hard: lateness is intolerable Pass/Fail.
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Module 2 Priority Driven Scheduling of Periodic Task
1 NUS.SOC.CS5248 OOI WEI TSANG Playout Buffer Management.
CPU Reservations and Time Constraints: Implementation Experience on Windows NT John Regehr – University of Virginia Michael B. Jones – Microsoft Research.
CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems.
Chapter 6 Dynamic Priority Servers
Project 2 – solution code
NUS.SOC.CS Roger Zimmermann (based on slides by Ooi Wei Tsang) Systems Support for Continuous Media.
Building Resource-Aware Applications and Systems Michael B. Jones Microsoft Research.
Embedded Systems Exercise 3: Scheduling Real-Time Periodic and Mixed Task Sets 18. May 2005 Alexander Maxiaguine.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
Computer Organization Review and OS Introduction CS550 Operating Systems.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Fair Resource Access & Allocation  OS Scheduling
1 Cache Me If You Can. NUS.SOC.CS5248 OOI WEI TSANG 2 You Are Here Network Encoder Sender Middlebox Receiver Decoder.
1 Multimedia Storage Issues. NUS.SOC.CS5248 OOI WEI TSANG 2 Media vs. Documents large file size write once, read many deadlines!
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Page 110/9/2015 CSE 40373/60373: Multimedia Systems So far…  RMS - task with highest rate has highest priority  EDF – earliest deadline first  Tasks.
NUS.SOC.CS5248 Ooi Wei Tsang Previously, on CS5248..
NUS.SOC.CS Roger Zimmermann (based on slides by Ooi Wei Tsang) Systems Support for Continuous Media.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
NUS.SOC.CS5248 Ooi Wei Tsang 1 CPU Scheduling. NUS.SOC.CS5248 Ooi Wei Tsang 2 Scheduling Task vs I/O Request Task computation time unpredictable Task.
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.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni.
1 Scheduling Processes with Release Times, Deadlines, Precedence and Exclusion Relations J. Xu and D. L. Parnas IEEE Transactions on Software Engineering,
RTOS task scheduling models
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
NUS.SOC.CS Roger Zimmermann (based on slides by Ooi Wei Tsang) Systems Support for Continuous Media.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
Special Class on Real-Time Systems
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
NUS.SOC.CS5248 Ooi Wei Tsang 1 Proxy Caching for Streaming Media.
Lecture 2, CS52701 The Real Time Computing Environment I CS 5270 Lecture 2.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Real-Time Operating System Design
Lecture 12 Page 1 CS 111 Online Using Devices and Their Drivers Practical use issues Achieving good performance in driver use.
CS333 Intro to Operating Systems Jonathan Walpole.
For a good summary, visit:
NUS.SOC.CS5248 Ooi Wei Tsang 1 Course Matters. NUS.SOC.CS5248 Ooi Wei Tsang 2 Make-Up Lecture This Saturday, 23 October TR7, 1-3pm Topic: “CPU scheduling”
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
Lecture 6: Real-Time Scheduling
Real-Time Operating Systems RTOS For Embedded systems.
NUS.SOC.CS5248 Ooi Wei Tsang Systems Support for Continuous Media.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
REAL-TIME OPERATING SYSTEMS
Chapter 6: CPU Scheduling (Cont’d)
CS5248: Systems Support for Continuous Media
Operating Systems Design (CS 423)
Scheduling and Resource Access Protocols: Basic Aspects
Networks and Operating Systems: Exercise Session 2
Unit OS9: Real-Time and Embedded Systems
Real Time Scheduling Mrs. K.M. Sanghavi.
CSCI1600: Embedded and Real Time Software
Chapter 6: CPU Scheduling
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

1 Course Matters

NUS.SOC.CS5248 OOI WEI TSANG 2 Paper Review October 2003 MonTueWedThuFriSatSun Paper Reviews Due 20% off for each late day

NUS.SOC.CS5248 OOI WEI TSANG 3 Diwali/Deepavali October 2003 MonTueWedThuFriSatSun No Class

NUS.SOC.CS5248 OOI WEI TSANG 4 Guest Lecture October 2003 MonTueWedThuFriSatSun CS6212 Guest Lecture “A/V Synchronization” SR1 4-6pm

NUS.SOC.CS5248 OOI WEI TSANG 5 Books

NUS.SOC.CS5248 OOI WEI TSANG 6 Project Grading

7 Previously, on CS5248

NUS.SOC.CS5248 OOI WEI TSANG 8 Cello OS disk scheduler Support multiple classes Protect classes from each other Work conserving Use two-level scheduling

NUS.SOC.CS5248 OOI WEI TSANG 9 CPU vs Disk Scheduling Task computation time unpredictable Task can be preemptive

NUS.SOC.CS5248 OOI WEI TSANG 10 Problem How can multimedia applications co-exists with normal applications?

NUS.SOC.CS5248 OOI WEI TSANG 11 Same Old Idea

NUS.SOC.CS5248 OOI WEI TSANG 12 Same Gang P. Goyal, X. Guo, and H. M. Vin. “A hierarchical CPU scheduler for multimedia operating systems.” OSDI’96

NUS.SOC.CS5248 OOI WEI TSANG 13 So Far Best-Effort Real-Time Scheduling

NUS.SOC.CS5248 OOI WEI TSANG 14 How to Guarantee Services?

15 Resource Reservation: CPU

NUS.SOC.CS5248 OOI WEI TSANG 16 Resource Reservations How to reserve? Overbook? Overuse?

NUS.SOC.CS5248 OOI WEI TSANG 17 Example: Memory How to reserve? malloc Overbook? return NULL Overuse? crash, throw exception

NUS.SOC.CS5248 OOI WEI TSANG 18 Example: Memory How to reserve? “I will need 128KB” Overbook? “Sorry!” Overuse? malloc returns NULL

NUS.SOC.CS5248 OOI WEI TSANG 19 Example: CPU How to reserve? Overbook? Overuse? Memory is discrete. CPU time is continuous.

20 How to Reserve?

NUS.SOC.CS5248 OOI WEI TSANG 21 CPU Reservation “I need C units of time, out of every T units.”

NUS.SOC.CS5248 OOI WEI TSANG 22 Two Problems How to determine C? take measurement and estimate What if C is not constant? take the maximum

NUS.SOC.CS5248 OOI WEI TSANG 23 Effects of T and C

24 CPU Scheduling Algorithm

25 Classic Real-Time Scheduler

NUS.SOC.CS5248 OOI WEI TSANG 26 Rate Scheduling Algorithms Rate Monotonic Earliest Deadline First

NUS.SOC.CS5248 OOI WEI TSANG 27 Rate Monotonic

NUS.SOC.CS5248 OOI WEI TSANG 28 EDF

NUS.SOC.CS5248 OOI WEI TSANG 29 Classic Schedulability Theorems Rate Monotonic Scheduler Earliest Deadline First

NUS.SOC.CS5248 OOI WEI TSANG 30 Assumptions programs are periodic computation time is constant zero context switch time programs are independent

NUS.SOC.CS5248 OOI WEI TSANG 31 Why do we care about RM? Theoretically, RM has lower CPU utilization (70%) but RM is more efficient than EDF Can support up to 80-90% CPU utilization in practice Don’t want to commit 100% CPU anyway (for emergency)

32 Rialto Scheduler From MS Research

NUS.SOC.CS5248 OOI WEI TSANG 33 Overview Given a set of task, pre-compute a scheduling graph

NUS.SOC.CS5248 OOI WEI TSANG 34 TaskABCDEF Amount Period EBCA EBFD EBA EBD

NUS.SOC.CS5248 OOI WEI TSANG 35 TaskABCDEF Amount Period C F A D EB

NUS.SOC.CS5248 OOI WEI TSANG 36 Advantages Only need to make new scheduling decisions when new task is added

NUS.SOC.CS5248 OOI WEI TSANG 37 Computing Scheduling Graph Input: A set of tasks with their reservations Output: A scheduling graph if feasible

NUS.SOC.CS5248 OOI WEI TSANG 38 Many Possible Solutions C F A D EB F C A D EB

NUS.SOC.CS5248 OOI WEI TSANG 39 TaskABCDEF Amount Period C F F A D EB

NUS.SOC.CS5248 OOI WEI TSANG 40 Computing Scheduling Graph Input: A set of tasks with their reservations Output: A scheduling graph if feasible Goals: (a) Minimize context switches (b) Distribute free time evenly

NUS.SOC.CS5248 OOI WEI TSANG 41 Life is Tough.. NP-Hard

NUS.SOC.CS5248 OOI WEI TSANG 42 Heuristic 10

NUS.SOC.CS5248 OOI WEI TSANG F TaskABCDEF Amount Period

NUS.SOC.CS5248 OOI WEI TSANG F B+E TaskABCDEF Amount Period

NUS.SOC.CS5248 OOI WEI TSANG F B+E A+D C TaskABCDEF Amount Period

NUS.SOC.CS5248 OOI WEI TSANG 46 TaskABCDEF Amount Period EBC EBDA EBF EBAD

47 Time Constraints

NUS.SOC.CS5248 OOI WEI TSANG 48 Time Constraint “I need to run the following code, that takes 30ms, 100ms from now, and the deadline is (now+180ms).”

NUS.SOC.CS5248 OOI WEI TSANG 49 Pseudocode can = begin_constraint(start_time, deadline, estimate) if can schedule then do work else adapt time_taken = end_constraint()

NUS.SOC.CS5248 OOI WEI TSANG 50 Scheduling Constraints C F F A D EB

NUS.SOC.CS5248 OOI WEI TSANG 51 Scheduling Constraints C F F A D EB C1, C2, C5

NUS.SOC.CS5248 OOI WEI TSANG 52 Advantages of Scheduling Graph Only need to make new scheduling decisions when new task is added Feasibility of time constraint can be predicted accurately

53 Peaceful Coexistence

NUS.SOC.CS5248 OOI WEI TSANG 54 Running Unreserved Task C F F A D EB

55 Media Player on Rialto/NT

NUS.SOC.CS5248 OOI WEI TSANG 56 Look inside NT Scheduler Scheduling unit : Thread Priority level: 1-15, rt 24 high 13 normal 8 idle 4

NUS.SOC.CS5248 OOI WEI TSANG 57 Priority Boosting Example: Priority +6 after awaken by keyboard input

NUS.SOC.CS5248 OOI WEI TSANG 58 Anti-Starvation If hasn’t run for 3 seconds Boost priority to 14 Avoid “Priority Inversion”

NUS.SOC.CS5248 OOI WEI TSANG 59 Mars Pathfinder

NUS.SOC.CS5248 OOI WEI TSANG 60 Rialto/NT NT Scheduler Rialto C F F A D EB Boost Priority to 30

NUS.SOC.CS5248 OOI WEI TSANG 61 Win Media Player 6.4 PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 62 Experiment 1 WMP running alone PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 63 Experiment 2 WMP running with priority 8 competitor PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 64 Experiment 3 WMP running with priority 10 competitor PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 65 Experiment 5 WMP running with priority 10 competitor PeriodPriorityReservationThread 1024Kernel Mixer 458GUI 10015Timer /1024MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 66 Experiment 6 WMP running with priority 10 competitor PeriodPriorityReservationThread 10241/16Kernel Mixer 458GUI 10015Timer /1024MP3 Decoder 5008Unknown 20008Disk Reader

NUS.SOC.CS5248 OOI WEI TSANG 67 Experiment 7 WMP running with priority 10 competitor PeriodPriorityReservationThread 1024Kernel Mixer 458GUI 10015Timer /512MP3 Decoder 5008Unknown 20008Disk Reader

68 Summary

NUS.SOC.CS5248 OOI WEI TSANG 69 CPU Scheduling With guarantee percentage of CPU time task with deadline Algorithms Rate-monotonic EDF Rialto

NUS.SOC.CS5248 OOI WEI TSANG 70 CS5248 Summary Network Encoder Sender Middlebox Receiver Decoder

NUS.SOC.CS5248 OOI WEI TSANG 71 Last Two Lectures October/November 2003 MonTueWedThuFriSatSun

NUS.SOC.CS5248 OOI WEI TSANG 72 Last Two Lectures Papers from recent conferences and journals.