CSCI1600: Embedded and Real Time Software

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 Scheduling.
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
Washington WASHINGTON UNIVERSITY IN ST LOUIS Resource and Resource Access Control Fred Kuhns Applied Research Laboratory Computer Science and Engineering.
Introduction to Embedded Systems Resource Management - III Lecture 19.
Priority INHERITANCE PROTOCOLS
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
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.
CPE555A: Real-Time Embedded Systems
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
An Introduction to Real Time Systems
Module 2 Priority Driven Scheduling of Periodic Task
Chapter 6 Dynamic Priority Servers
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
Deterministic Scheduling
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 –
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
Module 2 Clock-Driven Scheduling
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.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
2.5 Scheduling Given a multiprogramming system. Given a multiprogramming system. Many times when more than 1 process is waiting for the CPU (in the ready.
6. Application mapping 6.1 Problem definition
RTOS task scheduling models
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05.
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.
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
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 6: Real-Time Scheduling
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Real-Time Operating Systems RTOS For Embedded systems.
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.
Embedded System Scheduling
REAL-TIME OPERATING SYSTEMS
EMERALDS Landon Cox March 22, 2017.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Scheduling and Resource Access Protocols: Basic Aspects
Networks and Operating Systems: Exercise Session 2
Wayne Wolf Dept. of EE Princeton University
Unit OS9: Real-Time and Embedded Systems
EEE 6494 Embedded Systems Design
Lecture 4 Schedulability and Tasks
Lecture 24: Process Scheduling Examples and for Real-time Systems
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
ICS 143 Principles of Operating Systems
Chapter 6 Dynamic Priority Servers
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
CHAPTER 8 Resources and Resource Access Control
A) Is taskset with (period, comp-time) = (3, 1) (5, 1) (5, 1)
CSCI1600: Embedded and Real Time Software
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

CSCI1600: Embedded and Real Time Software Lecture 27: Real Time Scheduling II Steven Reiss, Fall 2016

Rate Monotonic Scheduling Consider (8,4) , (10,2) , (12,3) Utilization = 0.5 + 0.2 + 0.25 = 0.95 RM fails: (WHY) Are the tasks schedulable? Lecture 27: Scheduling II 2/23/2019

Dynamic Priority Scheduling Priorities are changed dynamically for different tasks Otherwise same simplifying assumptions Approaches to assigning priorities Basic idea: give priority to the job that needs it the most Least laxity (least slack) first Earliest deadline first Lecture 27: Scheduling II 2/23/2019

Least Laxity First Laxity = time until deadline – compute time remaining This is a measure of how stressed we are to finish the job Small laxity implies high priority Lecture 27: Scheduling II 2/23/2019

Least Laxity Scheduling (8,4) , (10,2) , (12,3) 6 : Laxity = X, X, 3 0 :Laxity = 4, 8, 9 7 : Laxity = X, X, 3 1 : Laxity = 4, 7, 8 8 : Laxity = 4, X, 3 2 : Laxity = 4, 6, 7 9 : Laxity = 4, X, X 3 : Laxity = 4, 5, 6 10 : Laxity = 4, 8, X 4 : Laxity = X, 4, 5 11 : Laxity = 4, 7, X 5 : Laxity = X, 4, 4 12 : Laxity = X, 7, 9 … Lecture 27: Scheduling II 2/23/2019

Least Laxity First Is optimal Is complex When do priorities change Can schedule as long as utility is <= 1 Is complex When do priorities change The laxity of a task changes dynamically If it is not currently executing How would you implement this Generally not used Too much context switching, bookkeeping Can we approximate it? Lecture 27: Scheduling II 2/23/2019

Earliest Deadline First (EDF) Put tasks in priority queue based on actual deadline Time when job needs to be done Priorities change only when a job is added EDF is also optimal If the utility is <= 1 then EDF will create a schedule Can transform any feasible schedule into an EDF one But this is based on assumptions Perfect periodic tasks, zero overhead, independence Lecture 27: Scheduling II 2/23/2019

Earliest Deadline First Scheduling (8,4) , (10,2) , (12,3) 0 : [8,10,12] 8 : [ 10, 12, 16] 10 : [ 12, 16, 20 ] Lecture 27: Scheduling II 2/23/2019

EDF Scheduling Why is this sufficient? P1(4,1), P2(6,3), P3(10,3) Lecture 27: Scheduling II 2/23/2019

EDF Seems Ideal Easy to implement, optimal, … But only in an ideal world If the workload is briefly non-schedulable Then both fail dramatically and unpredictably Choices are based on deadlines, not importance Work hard to display MPG rather than firing airbag Work only with idealized situations We need to relax the simplifying conditions Sporadic and aperiodic tasks Lecture 27: Scheduling II 2/23/2019

Handling Overloads Why bother Tasks might take longer than expected Sporadic tasks (interrupts, etc.) Might be unavoidable In EDF if one job is late and the system is loaded Then ALL future jobs might be late Techniques What might you want to do? Lecture 27: Scheduling II 2/23/2019

Techniques for Handling Overload Schedule late jobs at lower priority than on-time jobs Change non-critical jobs to optional when late jobs occur Discard jobs that cannot complete Tradeoffs What are the effects of each of these What might you use in practice Depends on application Lecture 27: Scheduling II 2/23/2019

Relaxing Constraints Non-preemptability Resource Contention Self-suspension Context Switching time Sporadic and aperiodic jobs Job dependencies Multiple cores/threads/processors Lecture 27: Scheduling II 2/23/2019

Relaxing Non-Preemptability Compute maximum time a task might be non-preemptable Compute maximum time a task might be delayed By a non-preemptable task Only need to consider tasks of lower priority Add this to its execution time when deriving schedule Lecture 27: Scheduling II 2/23/2019

Resource Contention Recall what can happen with locks and priorities Even without deadlock and race conditions Can have priority inversions Lecture 27: Scheduling II 2/23/2019

Priority Protocols τ1 τ2 τ3 t t+2 t+3 t+253 t+254 Blocked! L L L R L ... L L τ3 L L L R R t t+2 t+3 t+253 t+254 Lecture 27: Scheduling II 2/23/2019

Fixing Priority Inversions Make critical sections non-preemptable This works, but … Critical tasks can be delayed Lecture 27: Scheduling II 2/23/2019

Immediate Priority Ceiling Protocol Assign priorities based on resources Associate a priority ceiling p with each resource r The highest priority task that can lock it No task with priority >= p is allowed to lock r Task acquiring r runs at priority p Lecture 27: Scheduling II 2/23/2019

Priority Inheritance Protocol If Ti blocks Tk, execute Ti with priority min(i,k) Change priority of a task someone is blocked by it Which should you use? Lecture 27: Scheduling II 2/23/2019

Handling Self-Suspension Why would this ever happen? Wait for I/O operations, etc. Split into two tasks Second task might have a shorter deadline Take the suspension time into account when computing schedule Lecture 27: Scheduling II 2/23/2019

Handling Context Switching Time Compute the max # of context switches for a task From its period and higher priority tasks Worst case Add the context switching time * max To the execution time of the task Lecture 27: Scheduling II 2/23/2019

Sporadic Tasks Sporadic tasks Question: how to schedule these Goal Arise occasionally Hard deadlines Question: how to schedule these How to accommodate in RM/DM or EDF schedules Goal Tell accept/reject when job is submitted If accepted, then job will meet its deadline Lecture 27: Scheduling II 2/23/2019

Sporadic Jobs and EDF Schedules EDF will find a schedule as long as U <= 1 Keep track of U for the current system Utilization of the periodic tasks Plus the U for all accepted sporadic tasks Compute U’ as current U plus U of the sporadic task If this is <= 1 then accept Otherwise reject Lecture 27: Scheduling II 2/23/2019

Sporadic Jobs and RM Schedules What guarantees can we make here? U <= x where x depends on the number of tasks This allows us to use the same approach Just check with <= X for appropriate X Lecture 27: Scheduling II 2/23/2019

Homework Read 12.5 Exercise 12.5 Lecture 27: Scheduling II 2/23/2019

Aperiodic Job Scheduling Aperiodic Tasks Arise occasionally Soft deadlines Might be prioritized Goal: minimize worst/average case performance Lecture 27: Scheduling II 2/23/2019

Simple Aperiodic Scheduling Run aperiodic tasks in open slots How to schedule them Round robin Prioritized round robin Run tasks with higher priorities first Allocate CPU time according to priority This gives no guarantees of performance And complicates the scheduler Lecture 27: Scheduling II 2/23/2019

Priority Ceiling Protocol Original Priority Ceiling Protocol Task’s priority is raised when a higher-priority task tries to acquire the lock Raised to priority ceiling of the resource Task can acquire a lock r only if the task’s priority is strictly higher than the priority ceilings of all locks currently held by other tasks Lecture 27: Scheduling II 2/23/2019