CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.

Slides:



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

Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Priority Inheritance and Priority Ceiling Protocols
Introduction to Embedded Systems Resource Management - III Lecture 19.
Priority INHERITANCE PROTOCOLS
CprE 458/558: Real-Time Systems
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Fault-Tolerant Scheduling Techniques.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Reclaiming (Contd.)
CSE 522 Real-Time Scheduling (4)
Chapter 5 – Fixed-Priority Servers Typical Real-Time systems are hybrids characterized by: periodic tasks that execute critical control activities aperiodic.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems (m, k)-firm tasks and QoS enhancement.
Sporadic Server Scheduling in Linux Theory vs. Practice Mark Stanovich Theodore Baker Andy Wang.
Chapter 6 Dynamic Priority Servers
Project 2 – solution code
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Fixed-Priority Servers
Embedded Systems Exercise 3: Scheduling Real-Time Periodic and Mixed Task Sets 18. May 2005 Alexander Maxiaguine.
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 –
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Best Effort Scheduling.
Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CS3530 OPERATING SYSTEMS Summer 2014 Processor Scheduling Chapter 5.
Scheduling Aperiodic and Sporadic Jobs
Round Robin Scheduling A preemptive scheduling designed for Time Sharing Systems The Ready Queue is treated as a circular queue A small execution.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
1 Reducing Queue Lock Pessimism in Multiprocessor Schedulability Analysis Yang Chang, Robert Davis and Andy Wellings Real-time Systems Research Group University.
Scheduling policies for real- time embedded systems.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
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.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
RTOS task scheduling models
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Term Project List, Requirements.
Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.
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.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
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.
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
CS333 Intro to Operating Systems Jonathan Walpole.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
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.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
Lecture 6: Real-Time Scheduling
Real-time Embedded Systems Rate monotonic theory scheduling.
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.
OPERATING SYSTEMS CS 3502 Fall 2017
Scheduling and Resource Access Protocols: Basic Aspects
Lecture 4 Schedulability and Tasks
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Lecture 21: Introduction to Process Scheduling
Realtime Scheduling Algorithms
Chapter 6 Dynamic Priority Servers
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
Real Time Scheduling Mrs. K.M. Sanghavi.
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Resource access control -- example
Ch.7 Scheduling Aperiodic and Sporadic Jobs in Priority-Driven Systems
Presentation transcript:

CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks

CprE 458/558: Real-Time Systems (G. Manimaran)2 Assumptions & Issues RMS scheduling algorithm used All periodic tasks start at time t=0 (same as before) Periodic tasks relative deadlines are equal to end of period Arrival times of aperiodic tasks unknown Schedulability of periodic tasks Response time for aperiodic tasks Implementation considerations

CprE 458/558: Real-Time Systems (G. Manimaran)3 Background Scheduling Algorithm No server is created. Aperiodic tasks are executed when there is no periodic task to execute. Simple, but no guarantee on aperiodic schedulability Periodic tasks CPU Aperiodic tasks RMS FIFO/EDF… High priority Queue Low priority Queue

CprE 458/558: Real-Time Systems (G. Manimaran)4 Normal RMS schedule: Notice the holes Task set: T i = (c i, p i ) T1 = (2,6) and T2 = (4,10) Schedulability check: 2/6 + 4/10 = = 0.73 ≤ 2(√2 -1) = T11T11 T12T T21T21 T22T T1 T2 Hole Background scheduling: basic idea -- Scheduling aperiodic tasks in holes like this Schedule continues

CprE 458/558: Real-Time Systems (G. Manimaran)5 Background Scheduling: Example T11T11 T12T T21T21 T22T T1 T2 10 T13T13 12 T22T22 T14T Hole1 2 units Hole2 2 units Aperiodic tasks 12 A1A1 1 unit A2A2 Periodic tasks CPU Aperiodic tasks RMS FIFO High priority Queue Low priority Queue

CprE 458/558: Real-Time Systems (G. Manimaran)6 Combined Scheduling Creating a periodic server Ts=(Cs, Ps) for processing aperiodic workload. Create one or more server tasks. Aperiodic tasks are scheduled in the periodic server’s time slots. This policy could be based on deadline, arrival time, or computation time. Algorithms – all algorithms behave the same manner when there are enough aperiodic tasks to execute - Polling Server (bandwidth non-preserving) - Deferrable Server (bandwidth preserving) - Priority Exchange Server (bandwidth preserving) - Sporadic Server (bandwidth preserving)

CprE 458/558: Real-Time Systems (G. Manimaran)7 Polling Server A periodic server is created. If there are no aperiodic tasks at an invocation of the server (as per RMS), the server suspends itself during its current period and gets invoked again at its next period. If there are enough aperiodic tasks in an invocation, it serves up to Cs capacity. The computation time allowance for the server is replenished at the start of its period Include Ts in the task set and do schedulability test Poor response time for aperiodic tasks

CprE 458/558: Real-Time Systems (G. Manimaran)8 Polling server: Example Task set: T i = (c i, p i ) T1 = (1,4), T2 = (2,6) and Ts = (2,5) T1 T A1A A Aperiodic tasks Ts should be scheduled here as per RMS. However, as there is no aperiodic task to schedule, Ts suspends itself and is again available only at time = 5 This aperiodic task cannot be scheduled now as there is no server available till time = 5 Server becomes available and schedules aperiodic task A1 for 2 units Waits till time = 10 Server becomes available and can schedule for 2 units. However, aperiodic task A2 needs only 1 Waits till time = 15 Preempted by T1 Task set: T i = (c i, p i ) T1 = (1,4), T2 = (2,6) and Ts = (2,5)

CprE 458/558: Real-Time Systems (G. Manimaran)9 Polling server: Example (no animations) Task set: T i = (c i, p i ) T1 = (1,4), T2 = (2,6) and Ts = (2,5) T1 T A1A A Aperiodic tasks

CprE 458/558: Real-Time Systems (G. Manimaran)10 Polling server: Schedulability Analysis Schedulability analysis involves –Schedulability of periodic tasks –Schedulability of Aperiodic tasks Schedulability of periodic tasks can be evaluated by introducing a periodic task equivalent to the server. Therefore, the schedulability test is: ∑ i=1 to n (Ci / Pi) + (Cs / Ps) ≤ (n+1)[2 1/(n+1) -1]

CprE 458/558: Real-Time Systems (G. Manimaran)11 Polling server: Schedulability Analysis Aperiodic task guarantees: –Consider a single aperiodic task A i, arrived at r a, with computation time C a and deadline D a. Since an aperiodic task can wait at most for one period before receiving service, if C a ≤ Cs the request is certainly completed within two server periods. Thus it is guaranteed if 2P s ≤ D a Cs 0 Ps rara dada Ca D a > Ps

CprE 458/558: Real-Time Systems (G. Manimaran)12 Polling server: Schedulability Analysis Aperiodic task guarantees: –For arbitrary computation times, the aperiodic task is certainly completed in ceil(Ca/Cs) server periods; hence it is guaranteed if Ps + ceil(Ca/Cs) * Ps ≤ Da

CprE 458/558: Real-Time Systems (G. Manimaran)13 Deferrable Server A periodic server task is created. When the server is invoked with no outstanding aperiodic tasks, the server does not execute but defers its assigned time slot. When an aperiodic task arrives, the server is invoked (as per RMS) to execute aperiodic tasks and maintains its priority.

CprE 458/558: Real-Time Systems (G. Manimaran)14 Deferrable Server (Contd.) The computation time allowance for the server is replenished at the start of its period. Provides better response time for aperiodic tasks than Polling server Under overload, deadlines are missed predictably. Similar schedulability test like polling server

CprE 458/558: Real-Time Systems (G. Manimaran)15 Deferrable Server: Example Task set: T i = (c i, p i ) T1 = (1,4), T2 = (2,6) and Ts = (2,5) T1 T A1A Aperiodic tasks Don’t need to wait till time = 5 Don’t need to wait till time = 10 Server defers its capacity to handle any future aperiodic task Why is A2 not scheduled at time = 8 itself??? T1 runs from 8 to 9 and hence Ts a lower priority task cannot run till 9

CprE 458/558: Real-Time Systems (G. Manimaran)16 Priority Exchange Server A periodic server task is created. When the server invoked, the server runs if there are any outstanding aperiodic tasks. If no aperiodic task exists, the high priority server exchanges its priority with a lower priority periodic task for a duration of Cs’, where Cs’ is the remaining computation time of the server.

CprE 458/558: Real-Time Systems (G. Manimaran)17 Priority Exchange Server (Contd.) In this way, the priority of the server decreases, but its computation time is maintained. The computation time allowance for the server is replenished at the start of its period. As a consequence, the aperiodic tasks get low preference for execution. Offers worse response time compared to Deferrable Server. Better schedulability bound for periodic task set compared to Deferrable Server.

CprE 458/558: Real-Time Systems (G. Manimaran)18 Priority Exchange server: example THTH TSTS TLTL Cs TfTf Aperiodic task exists to utilize the server capacity THTH TSTS TLTL e Cs - e TfTf No more Aperiodic tasks to utilize the server capacity T L executing at the server’s priority T L executing at its own priority Server executing at T L ’s priority when there are aperiodic tasks to serve

CprE 458/558: Real-Time Systems (G. Manimaran)19 Sporadic Server This algorithm allows to enhance the average response time for aperiodic tasks without degrading the utilization bound for periodic task set This is achieved by varying the points at which the computation time of the server is replenished, rather than merely at the start of each server period. In other words, any spare capacity (i.e., not being used by periodic tasks) is available for an aperiodic task on its arrival.

CprE 458/558: Real-Time Systems (G. Manimaran)20 Sporadic server: example Task set: T i = (c i, p i ) T1 = (3,10), T2 = (4,15) and Ts = (2,8) T1 T A Aperiodic tasks 2 15 A1 Server has the highest priority Since no aperiodic task is there, the server defers its capacity Server schedules the aperiodic task right away with its capacity And, replenishes its capacity at time = current_time + period Server has no capacity to handle Server has capacity to schedule A2

CprE 458/558: Real-Time Systems (G. Manimaran)21 Priority-driven preemptive scheduling- summary Scheduling algorithms –RMS & EDF utilization test –RMS & DMS Exact analysis Combined Scheduling –Polling, Deferrable, PE, Sporadic servers Resource Access Control –Priority Inversion –Priority Inheritance & Pri. Ceiling Protocols –Schedulability tests accounting Blocking