Wayne Wolf Dept. of EE Princeton University

Slides:



Advertisements
Similar presentations
Simulation of Feedback Scheduling Dan Henriksson, Anton Cervin and Karl-Erik Årzén Department of Automatic Control.
Advertisements

Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Real Time Scheduling.
Real Time Scheduling Terminologies define Fixed Priority Scheduler
CSE 522 Real-Time Scheduling (4)
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.
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zMultiple tasks and multiple processes. ySpecifications.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Chapter 1 and 2 Computer System and Operating System Overview
Chapter 1 and 2 Computer System and Operating System Overview
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.
CprE 458/558: Real-Time Systems
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Scheduling policies for real- time embedded systems.
ICOM Noack Scheduling For Distributed Systems Classification – degree of coupling Classification – granularity Local vs centralized scheduling Methods.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems  Operating systems.
© 2000 Morgan Kaufman Overheads for Computers as Components Processes and operating systems Operating systems. 1.
6. Application mapping 6.1 Problem definition
RTOS task scheduling models
Module 2 Overview of Real Time System Scheduling
Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi.
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.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
CS333 Intro to Operating Systems Jonathan Walpole.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
Scheduling.
Lecture 6: Real-Time Scheduling
Real-Time Operating Systems RTOS For Embedded systems.
Embedded System Scheduling
Multiprocessor, Multicore, and Real-Time Scheduling Chapter 10
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
CPU SCHEDULING.
EC6703 EMBEDDED AND REAL TIME SYSTEMS
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Topics Covered What is Real Time Operating System (RTOS)
RTOS Scheduling 3 Cyclic scheduling, EDF. Tasks with precedence, Scheduling impact of DMA, cache, interrupts & context switch overhead, Aperiodic Georgio.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
EEE 6494 Embedded Systems Design
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Chapter 2.2 : Process Scheduling
Lecture 4 Schedulability and Tasks
Real-time Software Design
Lecture 24: Process Scheduling Examples and for Real-time Systems
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
OverView of Scheduling
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CPU SCHEDULING.
Multiprocessor and Real-Time Scheduling
Chapter 6: CPU Scheduling
Scheduling Basic Concepts Ref: Hard Real-Time Computing Systems Giorgio Buttazzo Ref: Real-Time Systems & Software Alan Shaw Processes - Tasks.
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Processes and operating systems
Chapter 10 Multiprocessor and Real-Time Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
CPU Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

Wayne Wolf Dept. of EE Princeton University wolf@princeton.edu Scheduling Wayne Wolf Dept. of EE Princeton University wolf@princeton.edu

Outline Review. Varieties of scheduling. Static scheduling. Feasibility. Scheduling algorithms.

Reactive systems Respond to external events. Engine controller. Seat belt monitor. Requires real-time response. System architecture. Program implementation. May require a chain reaction among multiple processors.

Real-time systems Perform a computation to conform to external timing constraints. Deadline frequency: Periodic. Aperiodic. Deadline type: Hard: failure to meet deadline causes system failure. Soft: failure to meet deadline causes degraded response. Firm: late response is useless but some late responses can be tolerated.

Why scheduling? The CPU is often shared among several processes. Cost. Energy/power. Physical constraints. Someone must be responsible for giving the CPU to processes. Co-operation between processes. RTOS.

Why CPU scheduling is not like hardware scheduling Large variation in run times. Asynchronous system architecture—no global clock to control processes. Larger data-dependent variations in run time, coupled with greater desire to take advantage of slack times. Processes may have variable start times.

Processes A process is a unique execution of a program. Several copies of a program may run simultaneously or at different times. A process has its own state: registers; memory. The operating system manages processes.

Timing requirements on processes Period: interval between process activations. Rate: reciprocal of period. Initiation time: time at which process becomes ready. Deadline: time at which process must finish.

Process characteristics Process execution time Ti. Execution time in absence of preemption. Possible time units: seconds, clock cycles. Worst-case, best-case execution time may be useful in some cases. Sources of variation: Data dependencies. Memory system. CPU pipeline.

State of a process A process can be in one of three states: executing on the CPU; ready to run; waiting for data. executing gets data and CPU gets CPU preempted needs data gets data ready waiting needs data

The scheduling problem Can we meet all deadlines? Must be able to meet deadlines in all cases. How much CPU horsepower do we need to meet our deadlines?

Scheduling metrics CPU utilization: Utilization: Fraction of the CPU that is doing useful work. Often calculated assuming no scheduling overhead. Utilization: U = [ S t1 ≤ t ≤ t2 T(t) ] / [t2 – t1]

Scheduling feasibility Resource constraints make schedulability analysis NP-hard. Must show that the deadlines are met for all timings of resource requests. P1 P2 I/O device

Simple processor feasibility Assume: No resource conflicts. Constant process execution times. Require: T ≥ Si Ti Can’t use more than 100% of the CPU. T1 T2 T3 T

Hyperperiod Hyperperiod: least common multiple (LCM) of the task periods. Must look at the hyperperiod schedule to find all task interactions. Hyperperiod can be very long if task periods are not chosen carefully.

Hyperperiod example Long hyperperiod: Shorter hyperperiod: P1 7 ms. LCM = 1155 ms. Shorter hyperperiod: P1 8 ms. P2 12 ms. P3 16 ms. LCM = 96 ms.

Simple processor feasibility example P1 period 1 ms, CPU time 0.1 ms. P2 period 1 ms, CPU time 0.2 ms. P3 period 5 ms, CPU time 0.3 ms.

Cyclostatic/TDMA Schedule in time slots. Same process activation irrespective of workload. Time slots may be equal size or unequal. T1 T2 T3 T1 T2 T3 P P

TDMA assumptions Schedule based on least common multiple (LCM) of the process periods. Trivial scheduler -> very small scheduling overhead. P1 P1 P1 P2 P2 PLCM

TDMA schedulability Always same CPU utilization (assuming constant process execution times). Can’t handle unexpected loads. Must schedule a time slot for aperiodic events.

TDMA schedulability example TDMA period = 10 ms. P1 CPU time 1 ms. P2 CPU time 3 ms. P3 CPU time 2 ms. P4 CPU time 2 ms.

Round-robin Schedule process only if ready. Variations: Always test processes in the same order. Variations: Constant system period. Start round-robin again after finishing a round. T1 T2 T3 T2 T3 P P

Round-robin assumptions Schedule based on least common multiple (LCM) of the process periods. Best done with equal time slots for processes. Simple scheduler -> low scheduling overhead. Can be implemented in hardware.

Round-robin schedulability Can bound maximum CPU load. May leave unused CPU cycles. Can be adapted to handle unexpected load. Use time slots at end of period.

Priority-driven scheduling Each process has a priority. CPU runs the highest-priority process that is ready. Priorities determine scheduling policy: fixed priority; time-varying priorities.

Priority-driven scheduling example Rules: each process has a fixed priority (1 highest); highest-priority ready process gets CPU; process continues until done. Processes P1: priority 1, execution time 10 P2: priority 2, execution time 30 P3: priority 3, execution time 20

Priority-driven scheduling example P3 ready t=18 P2 ready t=0 P1 ready t=15 P2 P1 P2 P3 10 20 30 40 50 60 time

Priority-driven schedulability Depends on priorities: Dynamic vs. static. Relationship to process execution times. Results depend on discipline: RMS. EDF.

Schedulability and CPU selection How fast a CPU do we need to make our system of processes schedulable? Process execution time depends on CPU. Ideal case: process execution time scales linearly.

Non-idealities in process scaling Within a single CPU model: Memory speed doesn’t scale with CPU speed. Across CPU models: Pipeline delays may vary. Memory system, etc.

Example: Space Shuttle software error Space Shuttle’s first launch was delayed by a software timing error: Primary control system PASS and backup system BFS. BFS failed to synchronize with PASS. Change to one routine added delay that threw off start time calculation. 1 in 67 chance of timing problem.