EEE 6494 Embedded Systems Design

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.
EE5900 Advanced Embedded System For Smart Infrastructure
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Outline Introduction Assumptions and notations
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.
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.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Resource Access Control Protocols.
CSE 522 Real-Time Scheduling (3)
An Introduction to Real Time Systems
Task Allocation and Scheduling n Problem: How to assign tasks to processors and to schedule them in such a way that deadlines are met n Our initial focus:
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.
EE 249, Fall Discussion: Scheduling Haibo Zeng Amit Mahajan.
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 –
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
Introduction to Embedded Systems
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Introduction to Embedded Systems Rabie A. Ramadan 6.
What Does Real-Time Mean? Main difference to other computation: time time means that correctness of system depends - not only on logical results - but.
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 Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
Real Time Operating Systems Schedulability - Part 3 Course originally developed by Maj Ron Smith 10/24/2015Dr Alain Beaulieu1.
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.
6. Application mapping 6.1 Problem definition
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
Special Class on Real-Time Systems
B. RAMAMURTHY 12/25/2015 Realtime System Fundamentals : Scheduling and Priority-based scheduling Pag e 1.
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,
Chapter 3: Real-Time Scheduling and Schedulability Analysis Albert M. K. Cheng.
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Lecture 2, CS52701 The Real Time Computing Environment I CS 5270 Lecture 2.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Real-Time Operating Systems RTOS For Embedded systems.
Embedded System Scheduling
REAL-TIME OPERATING SYSTEMS
Rate Monotonic Analysis Xinrong Zhou
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Scheduling and Resource Access Protocols: Basic Aspects
Wayne Wolf Dept. of EE Princeton University
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.
Real-Time Operating System (RTOS)
Realtime Scheduling Algorithms
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
Enforcing Real-Time Behavior I
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy Amrita-UB-MSES /11/2013.
CSCI1600: Embedded and Real Time Software
Resource access control -- example
Processes and operating systems
Real-Time Process Scheduling Concepts, Design and Implementations
Ch 4. Periodic Task Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Operating Systems
Real-Time Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

EEE 6494 Embedded Systems Design Real-Time Scheduling Algorithms 서강대학교 전자공학과

Agenda Real-Time System Classifications of Scheduling Assumption RM (Rate Monotonic) EDF (Earliest Deadline First) LLF (Least Laxity First) Shared Resources Conclusion

Real-Time System What is a real-time system? Correctness of system operation depends on temporal characteristics as well as logical/functional characteristics Characteristics definition of each task for analyzing a real-time system Core execution time (or computation time) Activation time (or release time) Deadline A point in time by which the task must complete Hard real-time system vs. Soft real-time system Relative deadline vs. Absolute deadline

Response Time = TimeActuation – TimeSensed (from Release to Response) A Service Release and Response WCET (Ci) Input/Output Latency Interference Time Interrupt Dispatch Preemption Interference Completion (IO Queued) Actuation (IO Completion) Input- Latency Dispatch- Execution Output- Response Time = TimeActuation – TimeSensed (from Release to Response) Event Sensed Time

Real-time Scheduling Algorithms Static/dynamic priority preemptive scheduling Static schedulability analysis : Results used at run-time - Good for periodic tasks but inflexible Dynamic : No explicit schedule, at run-time execute highest priority task first Period driven - Rate monotonic (RM), Deadline Monotonic Deadline driven - Earliest deadline first (EDF), Slack driven - Least slack (LLF) Flexible, but potentially dangerous I. Priority inversion Shared resources – Deadlock possibility Event-driven non-preemptive Tasks represented by functions (event handlers) Safe, but limited

Assumptions Liu and Layland assumed (in RM and EDF) All tasks are periodic Tasks are ready to run at their release time Tasks are independent : No shared resources, no synchronization No overhead costs for preemption, scheduling or interrupt handling Processing is fully preemptable

Rate Monotonic Scheduling Algorithm Idea of RM algorithm A lower-priority task is executing and a higher-priority task becomes available to execute, it will preempt the lower-priority task Static scheduling Shorter period tasks get higher priority

Priority : S1 > S2 > S3 Example of RM Scheduling Tasks Deadline (ms) Computation Time (ms) S1 D1 = 30 C1 = 10 S2 D2 = 55 C2 = 10 S3 D3 = 60 C3 = 5 10/30+10/55+5/60 S1 time 5 15 25 35 45 55 65 75 activation S2 S3 85 Priority : S1 > S2 > S3 deadline Preemption S2 S1

Rate Monotonic Scheduling Algorithm Schedulability Analysis( ) A set of n periodic tasks is schedulable by the RM algorithm if , where and meaning that any task set can be scheduled by RM if , but not all task sets can be scheduled if Ex) 10/30+10/55+5/60 p p

EDF Scheduling Algorithm Idea of EDF algorithm The scheduler reevaluates the deadlines of all tasks any time an interrupt occurs (a new task is activated or a task is finished), and allocates the resource to the task having the earliest deadline Dynamic scheduling Deadline-based preemption

Example of EDF Scheduling Task Period Relative Deadline Computation Time S1 T1 = 30 D1 = 30 C1 = 10 S2 T2 = 40 D2 = 40 C2 = 15 S3 T3 = 50 D3 = 50 C3 = 10 10/30+15/40+10/50 activation time 5 15 25 35 45 55 65 75 T1=30 S1 85 S2 S3 T2=40 T3=50 윤디자인연구소 www.yoondesign.co.kr

EDF Scheduling Algorithm Schedulability Analysis( ) A set of n periodic tasks is schedulable by the EDF algorithm if (computation time Ci , period Ti ) meaning that any task set can be scheduled by EDF if Ex) 10/30+15/40+10/50

Shared Resources Critical section Priority inversion Program section where a shared resource is accessed No other task can access this resource : Mutual exclusion Priority inversion A situation in which a higher priority job is blocked by lower priority jobs for an indefinite period of time

Priority : S1 > S2 > S3 Priority Inversion Protocol priority inversion Priority : S1 > S2 > S3 Can’t meet the deadline !! activation S1 time 5 15 25 35 45 55 65 75 85 activation S2 time 5 15 25 35 45 55 65 75 85 activation S3 time 5 15 25 35 45 55 65 75 85 Critical section

Two solutions of priority inversion problem PIP (Priority Inheritance Protocol) PCP (Priority Ceiling Protocol)

PIP (Priority Inheritance Protocol) If a task execution in a critical section blocks one or more higher priority tasks, then it temporarily inherits the highest priority of the blocked tasks When a task exits the critical section, it resumes the original priority it had when it entered that critical section

Priority : S1 > S2 > S3 Example of PIP Priority : S1 > S2 > S3 activation priority inheritance P(S1) P(S3) S1 time 5 15 25 35 45 55 65 75 85 activation S2 time 5 15 25 35 45 55 65 75 85 activation S3 time 5 15 25 35 45 55 65 75 85 Critical section

The PIP may also cause problems when more than one shared resource is used, by producing a chained blocking Chained blocking Execution: Task 4-> task 3 -> Task 2 -> Task1 Lowest-priority tasks execute first: may miss deadline

PCP (Priority Ceiling Protocol) Solution for chained blocking If a task execution in a critical section blocks, then it temporarily inherits the priority ceiling The priority ceiling is equal to the highest priority of the tasks that concurrently hold or will hold that resource (Lookahead) ‘Ceiling’ may be misleading

Priority : S1 > S2 > S3 > S4 Another Example (PIP applied) activation priority inheritance P(S2) P(S4) priority inheritance P(S1) P(S4) S1 time 5 15 25 35 45 55 65 75 85 95 activation S2 time 5 15 25 35 45 55 65 75 85 95 activation S3 time 5 15 25 35 45 55 65 75 85 95 activation S4 time 5 15 25 35 45 55 65 75 85 95 Critical section Priority : S1 > S2 > S3 > S4

When PCP is applied Critical section activation S1 time activation S2 5 15 25 35 45 55 65 75 85 95 activation S2 time 5 15 25 35 45 55 65 75 85 95 activation S3 time 5 15 25 35 45 55 65 75 85 95 the highest priority(S1) is inherited S4 time 5 15 25 35 45 55 65 75 85 95 Critical section Priority : S1 > S2 > S3 > S4

Schedulability Analysis( ) A set of n periodic tasks is schedulable by the EDF algorithm if (computation time Ci , period Ti ) And schedulable by the EDF based PCP algorithm if We denote this worst case blocking time of a job in task ti by Bi Ex) 10/60+10/75+5/75+25/95+25/75

Conclusion The scheduling of jobs with hard deadlines is an important area in real-time systems The choice of scheduling algorithm is very important in real-time systems