Mehdi Kargahi School of ECE University of Tehran

Slides:



Advertisements
Similar presentations
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Advertisements

REAL TIME SYSTEM Scheduling.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CPE555A: Real-Time Embedded Systems
Real Time Scheduling Terminologies define Fixed Priority Scheduler
THE UNIVERSITY of TEHRAN Mitra Nasri Sanjoy Baruah Gerhard Fohler Mehdi Kargahi October 2014.
CSE 522 Real-Time Scheduling (1) Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
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
Chapter 3: CPU Scheduling
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
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.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
Chapter 6: CPU Scheduling
More Scheduling cs550 Operating Systems David Monismith.
Module 2 Clock-Driven Scheduling
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
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.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Chapter 5 CPU Scheduling Bernard Chen Spring 2007.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
Object-Oriented Design and Implementation of the OE-Scheduler in Real-time Environments Ilhyun Lee Cherry K. Owen Haesun K. Lee The University of Texas.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
Mapping: Applications  Processors
Special Class on Real-Time Systems
CSE 522 Real-Time Scheduling (2)
Module 2 Overview of Real Time System Scheduling
Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
Common Approaches to Real-Time Scheduling Clock-driven (time-driven) schedulers Priority-driven schedulers Examples of priority driven schedulers Effective.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Dynamic Priority Driven Scheduling of Periodic Task
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Introduction to Real-Time Systems
For a good summary, visit:
2/23/2016COSC , Lecture 21 Real-Time Systems, COSC , Lecture 2 Stefan Andrei.
Clock Driven Schedulers
Process Scheduling Schedulers and Scheduling Methods.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
Real-Time Operating Systems RTOS For Embedded systems.
Clock-Driven Scheduling (in-depth) Task Scheduler: i := 0; k := 0; BEGIN LOOP i := i+1; k:= i mod N; IF J(t k-1 )is empty THEN wakeup(aperiodic) ELSE wakeup(J(t.
Embedded System Scheduling
EEE 6494 Embedded Systems Design
CprE 458/558: Real-Time Systems
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Mehdi Kargahi School of ECE University of Tehran Real-Time Scheduling Mehdi Kargahi School of ECE University of Tehran

M. Kargahi (University of Tehran) Common Approaches Clock-driven (time-driven) Scheduling decisions are made at specific time instants, which are typically chosen a priori Weighted round-robin (processor-sharing) Commonly used for scheduling time-shared applications The weights of jobs can speed up or retard the progress of each job toward its completion Priority-driven Scheduling decisions are made when particular events in the system occur, e.g., A job becomes available Processor becomes idle (a job is completed) Work-conserving: processor is busy whenever there is work to be done Priority driven schedulers can be static or dynamic depending on the priority assignment at run-time M. Kargahi (University of Tehran)

Clock-Driven Approaches: Overview Scheduling decision time: point in time when scheduler decides which job to execute next Scheduling decision time in clock-driven schedulers is defined a priori For example: scheduler periodically wakes up and generates a portion of the schedule Special case: When job parameters are known a priori, schedule can be pre-computed offline, and stored as a table (table-driven schedulers) M. Kargahi (University of Tehran)

Weighted Round-Robin Approaches: Overview The WRR algorithm has been used for scheduling real-time traffic in high-speed switched networks A RR scheduler delays the completion of every job For precedence constrained jobs, the response time of a chain of jobs can be unduly large  WRR is not suitable for scheduling such jobs WRR approach does not require a sorted priority queue, only a RR queue suitable for ultrahigh-speed networks, since queues with the required speed are expensive M. Kargahi (University of Tehran)

WRR, Sequential, and Piped Executions What if the results could be piped? J1,1 J1,2 J2,1 J2,2 P1 P2 J1,1&J2,1 J1,2&J2,2 WRR P1 P2 J1,1 J2,1 J1,2 J2,2 Sequential execution M. Kargahi (University of Tehran)

Priority-Driven Approaches: Overview Never leave processor idle when there is work to be done (such schedulers are also called work-conserving) Based on list-driven, greedy schedulers (tries to make locally optimal decisions) Examples: FIFO, LIFO, SETF, LETF, EDF An implementation of preemptive priority-driven scheduling: Assign priorities to jobs Scheduling decisions are made when Job becomes ready Processor becomes idle Priority of jobs change At each scheduling decision time, choose ready task with the highest priority In non-preemptive case, scheduling decisions are made only when processor becomes idle M. Kargahi (University of Tehran)

Example: Priority-Driven Scheduling Preemptive Non-preemptive Note the dynamic dispatching in the above schedule J5 J6 J7 J8 M. Kargahi (University of Tehran)

Effective Release Times and Deadlines Timing constraints are often inconsistent with precedence constraints Example: d1>d2, but J1J2 Effective timing constraints on a single processor: Effective release time: Effective deadline: The effective release time/deadline of all jobs can be computed in O(n2) where n is the number of jobs M. Kargahi (University of Tehran)

Effective Release Times and Deadlines In the above example, the effective release time of J3 is 2, and its effective deadline is 8 M. Kargahi (University of Tehran)

Optimality of the EDF Algorithm EDF: Earliest Deadline First EDF algorithm: At any time, execute the available job with the earliest deadline Theorem: When preemption is allowed and jobs do not contend for resources, the EDF algorithm can produce a feasible schedule of a set J of jobs with arbitrary release times and deadlines on a processor if and only if J has feasible schedules Note that the theorem applies even if tasks are not periodic If periodic, the task relative deadline, can be <, =, or > its period M. Kargahi (University of Tehran)

Optimality of the EDF Algorithm Proof: Assume that arbitrary schedule S meets timing constraints For S to not be an EDF schedule, we must have the following situation: Case 1: L(A)>L(B) M. Kargahi (University of Tehran)

Optimality of the EDF Algorithm Case 2: L(A)L(B) If we inductively repeat this procedure, we can eliminate all out-of-order violations The resulting schedule may still fail to be an EDF schedule because it has idle intervals while some job is ready Such idle intervals can be eliminated by moving some jobs forward M. Kargahi (University of Tehran)

LRT (reverse EDF) Scheduling Latest Release Time (LRT) Question: Is LRT a priority-driven scheduling algorithm? J1, 3 (0, 6] J2, 2 (5, 8] J3, 2 (2, 7] 2 4 8 6 J1 J3 J2 M. Kargahi (University of Tehran)

LST (MLF or LLF) Scheduling Least Slack-Time First (LST) Minimum Laxity First (MLF) or Least Laxity First (LLF) Slack (laxity): at any time t, the slack (or laxity) of a job with deadline d is equal to d - t minus the time required to complete the remaining portion of the job MLF scheduling: The job with the smallest slack (laxity) has the highest priority at all times MLF is also optimal (proof is similar to EDF) Question: Which of EDF or MLF is preferable in practice? M. Kargahi (University of Tehran)

Non-Optimality of EDF and LST Case 1: When preemption is not allowed Ji=(ri, di, ei) J1=(0, 10, 3) J2=(2, 14, 6) J3=(4, 12, 4) Case 2: On more than one processor J1=(0, 4, 1) J2=(0, 4, 1) J3=(0, 5, 5) 2 4 8 6 J1 J3 J2 12 10 14 2 4 8 6 J1 J3 J2 12 10 14 No NP priority-driven alg. is optimal when jobs have arbitrary ri, di, ei P1 P2 2 4 6 J1 J3 J2 2 J1 J3 4 5 J2 P1 P2 M. Kargahi (University of Tehran)

Anomaly with NP-Priority Sch. When jobs have arbitrary release times and share resources, scheduling anomalies can occur even with one processor and preemptable jobs Whether a set of jobs has predictable execution behavior depends not only on the parameters of jobs but also on the algorithm used to schedule the jobs M. Kargahi (University of Tehran)

Offline vs. Online Scheduling Offline scheduling Inflexibility Deterministic timing behavior for a deterministic system Complexity is not important Low run-time overhead Online scheduling The parameters of each job are known only after the job is released The only option for unpredictable workloads Flexibility and adaptability Reduced ability for best using of resources M. Kargahi (University of Tehran)

Example for an online scheduler Assume a non-preemptive job J1,1 (0, 2] Two options Start executing J1 at time 0 Postpone the execution of J1 to some later time x1 Selecting option 1: we may have J2,1-x (x<1, 1]miss J2 Selecting option 2: we may have J3,1 (x<1, 2]miss J3  A clairvoyant scheduler is required  No optimal online scheduling algorithm exists when some jobs are non-preemptable  When all jobs are preemptable and there is only 1 processor we have optimal online algorithms such as EDF and LST M. Kargahi (University of Tehran)

M. Kargahi (University of Tehran) Overloaded systems A system is overloaded when the jobs offered to the scheduler cannot be feasibly scheduled even by a clairvoyant scheduler Some measures Value of Ji = ei if Ji meets its deadline, or 0 otherwise V (schedule) = sum of the values of all jobs in the schedule Competitive factor for an online algorithm = c iff V (schedule) of any finite sequence of jobs produced by the alg. is at least c times of V (schedule) produced by an optimal clairvoyant alg. c=1 for EDF and LST, when jobs are preemptable, there is one processor, and the processor is not overloaded c=0 for EDF and LST, when the processor is overloaded Ex.: J1,2(0, ] & J2,e(, +e] V (EDF)=0, while V (Best)=e M. Kargahi (University of Tehran)