REAL TIME SYSTEM Scheduling.

Slides:



Advertisements
Similar presentations
Real Time Scheduling.
Advertisements

EE5900 Advanced Embedded System For Smart Infrastructure
Time Demand Analysis.
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
0 Synchronization Problem Resource sharing –Requires mutual exclusion –Critical section A code section that should be executed mutually exclusively by.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CPE555A: Real-Time Embedded Systems
1 Advanced Embedded Systems, BAE 5030 Presentation Topic: Rate Monotonic Analysis By Aswin Ramachandran
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
Mehdi Kargahi School of ECE University of Tehran
Is It Time Yet? Wing On Chan. Distributed Systems – Chapter 18 - Scheduling Hermann Kopetz.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Dynamic Planning Based Scheduling.
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
Problem 11: Complex Hierarchical Scheduling Full Processor FP T3T2 T4T1 EDF T6T5 RM T10T9T8T7 EDFSPS DPS 10 Tasks - with jitter - with bursts - deadline.
Project 2 – solution code
Resource Access Control (Part I) The Mars Pathfinder Incident Resource Model Priority Inversion.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
A Categorization of Real-Time Multiprocessor Scheduling Problems and Algorithms Presentation by Tony DeLuce CS 537 Scheduling Algorithms Spring Quarter.
More Scheduling cs550 Operating Systems David Monismith.
Task Scheduling By Dr. Amin Danial Asham.
Page 1 2P13 Week 9. Page 2 Table 9.2 Scheduling Criteria User Oriented, Performance Related Turnaround time This is the interval of time between the submission.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
RTOS task scheduling models
Real-Time Support for Mobile Robotics K. Ramamritham (+ Li Huan, Prashant Shenoy, Rod Grupen)
Embedded Systems OS. Reference Materials The Concise Handbook of Real- Time Systems TimeSys Corporation.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
End-To-End Scheduling Angelo Corsaro & Venkita Subramonian Department of Computer Science Washington University Distributed Systems Seminar, Spring 2003.
Distributed Process Scheduling : A Summary
Special Class on Real-Time Systems
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
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.
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
For a good summary, visit:
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.
1 G53SRP: Introduction to Real Time Scheduling Chris Greenhalgh School of Computer Science.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
From HRT-HOOD to C Real-Time Systems Lecture 6
Embedded System Scheduling
REAL-TIME OPERATING SYSTEMS
EMERALDS Landon Cox March 22, 2017.
Scheduling and Resource Access Protocols: Basic Aspects
Unit OS9: Real-Time and Embedded Systems
Accounting information and limits
Lecture 4 Schedulability and Tasks
Clock Driven Scheduling
CprE 458/558: Real-Time Systems
OverView of Scheduling
Real Time Scheduling Mrs. K.M. Sanghavi.
TDC 311 Process Scheduling.
ورود اطلاعات بصورت غيربرخط
Scheduling Basic Concepts Ref: Hard Real-Time Computing Systems Giorgio Buttazzo Ref: Real-Time Systems & Software Alan Shaw Processes - Tasks.
Chapter 10 Multiprocessor and Real-Time Scheduling
CS703 - Advanced Operating Systems
Real-Time Process Scheduling Concepts, Design and Implementations
The End Of The Line For Static Cyclic Scheduling?
Real-Time Process Scheduling Concepts, Design and Implementations
Constraint based scheduling
Presentation transcript:

REAL TIME SYSTEM Scheduling

Basics of Scheduling Usually Fewer Processor than tasks Adherence to timing constraints like deadline In a Multiprocessor (or MultiCore) environment, A scheduling decision is a decision to execute a task, and it has the following three parts: assignment: which processor should execute the task; ordering: in what order each processor should execute its tasks; and timing: the time at which each task executes.

Type of schedulers – Offline Fully static scheduler Doesn't require mutex or semaphore Difficult to realize Difficult to predict execution time Tasks typically have data dependent execution times Static order scheduler Tasks assignment and ordering at design time Defer until run time decision of when in physical time to execute a task Depend on whether locks could be acquired or precedence constraints are satisfied

Type of scheduler- Online Static assignment scheduler Assignment at design time rest at run time Fully dynamic scheduler When a processor become available scheduler decides which tasks should be assigned to it Preemptive scheduler Tasks can be removed while still executing and another task can be assigned the processor Tasks may be blocked if it try to acquire a lock and the lock is not available Non-preemptive scheduler

Times associated with a task Periodic tasks Sporadic tasks- repeat but timing is irregular Priority or precedence constraints Tasks may have preconditions

Comparing Schedulers Feasible schedule (fi<di) Optimal with respect to feasibility Processor utilization Maximum lateness Lmax=max(fi-di) where i belongs to T Help us to analyze infeasible schedules For soft real time system positive Lmax is not a problem Total completion time or Makespan M=max(fi) – min(ri) for all i belonging to T

Implementation of a Scheduler For preemptive scheduling the scheduler is invoked when any of several things occur: A timer interrupt occurs, for example at a jiffy interval. An I/O interrupt occurs. An operating system service is invoked. A task attempts to acquire a mutex. A task tests a semaphore. For interrupts, the scheduling procedure is called by the interrupt service routine In the other cases, the scheduling procedure is called by the operating system procedure that provides the service

RM – Rate monotonic Static priority protocol optimal with respect to feasibility among fixed priority uniprocessor schedulers for the above task model. This scheduling strategy gives higher priority to a task with a smaller period Cannot always achieve 100% utilization. In particular, RM schedulers are constrained to have fixed priority.

RM schedule for two tasks

RM Schedule Consider two tasks to be executed periodically on a single processor, where task 1 has period p1 = 4 and task 2 has period p2 = 6. Let the execution time of task 1 be e1 = 1. Find the maximum value for the execution time e2 of task 2 such that the RM schedule is feasible. Again let the execution time of task 1 be e1 = 1. Let non-RMS be a fixed-priority schedule that is not an RM schedule. Find the maximum value for the execution time e2 of task 2 such that non-RMS is feasible.

EDF simply executes the tasks in the same order as their deadlines, with the one with the earliest deadline going first dynamic priority scheduling algorithm. If a task is repeatedly executed, it may be assigned a different priority on each execution EDF is more expensive to implement than RM, in practice its performance is generally superior First, RM is optimal with respect to feasibility only among fixed priority schedulers, whereas EDF is optimal w.r.t. feasibility among dynamic priority schedulers EDF also minimizes the maximum lateness EDF results in fewer preemptions

Priority inversion It is a scheduling anomaly where a high-priority task is blocked while unrelated lower-priority tasks are executing

Mars Pathfinder: The Problem Two tasks were critical for controlling communication on the lander’s communication bus, the scheduler task (bc_sched) and the distribution task (bc_dist). Each of these tasks checked each cycle to be sure that the other had run successfully. time = 0.125 s bc_sched bc_dist bus active

Mars Pathfinder: The problem bc_dist was blocked by a much lower priority meteorological science task (ASI/MET) ASI/MET was preempted by several medium priority processes such as accelerometers and radar altimeters. bc_sched started and discovered that bc_dist had not completed. Under these circumstances, bc_sched reacted by reinitializing the lander’s hardware and software and terminating all ground command activities.

Problem resolution Logging designed into vxWorks enabled NASA and Wind River to reproduce the failure on Earth. This reproduction made the priority inversion obvious. NASA patched the lander’s software to enable priority inheritance.

Priority Inheritance protocol when a task blocks attempting to acquire a lock, then the task that holds the lock inherits the priority of the blocked task

Priority ceiling Protocol every lock or semaphore is assigned a priority ceiling equal to the priority of the highest-priority task that can lock it. A task t can acquire a lock a only if the task’s priority is strictly higher than the priority ceilings of all locks currently held by other tasks

Multiprocessor scheduling Scheduling tasks on multiple processor is even harder then scheduling tasks on a single scheduler Hu level scheduling algorithm Assigns priority to each task t based on the level it emphasizes the path through the precedence graph with the greatest total execution time Once priorities are assigned to tasks, a list scheduler sorts the tasks by priorities and assigns them to processors in the order of the sorted list as processors become available

Multiprocessor scheduling A schedule for task 1-6 on two processors Makespan is 4

Scheduling anomalies Unexpected or counterintuitive behaviors emerge due to small changes in the operating condition of a system Improvements in performance at a local level can result in degradations in performance at a global level,

Scheduling anomalies Nine tasks scheduled on three processors Execution time of tasks reduced by one time unit

Scheduling anomalies Adding one more processor Removing precedence between tasks 4,7, and 8

Scheduling anomalies Anomaly due to mutual exclusion locks Tasks 2 and 4 contend for a mutex. If the execution time of task 1 is reduced, then the order of execution of tasks 2 and 4 reverses, which results in an increased execution time.