11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science.

Slides:



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

Introduction to Embedded Systems Resource Management - III Lecture 19.
Priority INHERITANCE PROTOCOLS
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
CSE 522 Real-Time Scheduling (4)
From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka.
Module 2 Priority Driven Scheduling of Periodic Task
Scheduling Goal Topics
Scheduling Theory ITV Real-Time Systems Anders P. Ravn Aalborg University March 2007.
Programming R-T Abstractions TSW November 2009 Anders P. Ravn Aalborg University.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Scheduling Theory ITV Multiprogramming and Real-Time Programs Anders P. Ravn Aalborg University May 2009.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the RTSJ  Memory Management.
Embedded Systems Exercise 3: Scheduling Real-Time Periodic and Mixed Task Sets 18. May 2005 Alexander Maxiaguine.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
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 –
Misconceptions About Real-time Computing : A Serious Problem for Next-generation Systems J. A. Stankovic, Misconceptions about Real-Time Computing: A Serious.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
The Design and Performance of A Real-Time CORBA Scheduling Service Christopher Gill, David Levine, Douglas Schmidt.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Scheduling policies for real- time embedded systems.
T.B. Skaali, Department of Physics, University of Oslo) FYS 4220 / 9220 – 2012 / #8 Real Time and Embedded Data Systems and Computing Scheduling of Real-Time.
Multiprocessor Real-time Scheduling Jing Ma 马靖. Classification Partitioned Scheduling In the partitioned approach, the tasks are statically partitioned.
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
11 G53SRP: Deadline misses and cost over-runs in RTSJ Chris Greenhalgh School of Computer Science.
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)
Real Time Systems Real-Time Schedulability Part I.
RTOS task scheduling models
EEL Real-time Java part 2. EEL Acknowledgements All the lecture slides were adopted from the slides of Andy Wellings.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
111 G53SRP: RTSJ Memory Areas Chris Greenhalgh School of Computer Science.
CSE 522 Real-Time Scheduling (2)
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.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Thread Scheduling and Dispatching Maung Aung Han Marc E. Loy Jihua Zhong CIS 642: Seminar in Real-time Systems Instructor: Professor Insup Lee.
Dynamic Priority Driven Scheduling of Periodic Task
Introduction to Real-Time Systems
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
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.
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.
Process Scheduling Schedulers and Scheduling Methods.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Lecture 6: Real-Time Scheduling
Undergraduate course on Real-time Systems Linköping TDDD07 – Real-time Systems Lecture 1: Introduction & Scheduling I Simin Nadjm-Tehrani Real-time Systems.
Embedded System Scheduling
Scheduling in Real-Time Systems
Chapter 6: CPU Scheduling
G53SRP: Real Time Threads in RTSJ (part I)
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Process management Information maintained by OS for process management
G53SRP: Asynchronous Events in RTSJ
G53SRP: Resource Sharing Issues
Real Time Scheduling Mrs. K.M. Sanghavi.
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Ch 4. Periodic Task Scheduling
Presentation transcript:

11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science

22 Contents IntroductionIntroduction Process and scheduling model Utilisation tests Response time analysis Run-time feasibility testing in RTSJ SummarySummary Book: Wellings Ch. 10 (part), Burns & WellingsBook: Wellings Ch. 10 (part), Burns & Wellings ; , 13.7, 13.9, (part)

3 Introduction Feasibility = whether a set of processes, if scheduled correctly, will meet their deadlines – –RTSJ: all active RealtimeThread s and AsyncEventHandler s (i.e. Schedulable s) Also known as “Schedulability” Can be determined analytically given enough information about the system…

4 (Simple) Process and scheduling model Fixed set of processes Known worst-case execution times Independent processes – –See later notes for some information on dealing with competition between threads Periodic; known deadlines Zero time context switch Correctness = meet deadlines Priority-based scheduling – –Pre-emptive – –No timeslicing

5 Process parameters: D = deadline (time period) – –RTSJ: ReleaseParameters deadline T = period of periodic process – –RTSJ: PeriodicParameters period – –Sporadic process minimum interarrival time – –RTSJ: SporadicParameters minimumInterarrival – –Feasibility analysis not possible for aperiodic processes, i.e. no process set with an aperiodic process is feasible C = worst case execution time – –RTSJ: ReleaseParameters cost

6 Scheduling approach Fixed Priority Scheduling (FPS) – –RTSJ: PriorityScheduler – –Single fixed priority allocated in advance for each process – –Runnable processes executed in order of priority Deadline Monotonic Priority Order (DMPO) – –Allocate highest priority to shortest deadline – –Provably optimal for FPS – –RTSJ: Priorities specified by programmer via SchedulerParameters ( PriorityParameters )

7 Schedulability (1): Utilisation tests Is there enough CPU capacity? – –Sum(C i /T i ) <= 1 But: – –Necessary (not sufficient) – –D=T only Fraction of CPU used by process Total CPU (no. of CPUs)

8 For example: Process set – –Proc.TC ––152––152 ––242––242 Utilization = 2/5+2/4 = 0.85 – –Might be schedulable :-/ Process set –Proc.TC –153–153 –242–242 Utilization = 3/5+2/4 = 1.10 –Definitely not schedulable

9 Example time-line (first case) 2/ Time Process 1 2 2/2 Process Release Time Process Completion Time Deadline Met Process Completion Time Deadline Missed Executing Preempted (consider P1 cost=2.01 => U = 0.852!)

10 Example time-line (second case) 2/ Time Process 1 2 2/3 Process Release Time Process Completion Time Deadline Met Process Completion Time Deadline Missed Executing Preempted

11 Schedulability (2): Utilisation bound test (Liu & Leyland) Is there enough CPU capacity? – –Sum(C i /T i ) <= N(2 (1/N) -1) But: – –Sufficient (not necessary) – –D=T only – –1 CPU N N(2 (1/N) -1)  0.69 Jolly clever formula worked out by Liu & Leylard (see Burns & Wellings)

12 For example: Process set – –Proc.TC ––152––152 ––241––241 Utilization = 2/5+1/4 = 0.65 – –Bound 2 processes = – –Schedulable!

13 Example time-line … 1/ Time Process 1 2 2/2 Process Release Time Process Completion Time Deadline Met Process Completion Time Deadline Missed Executing Preempted

14 Process Period ComputationTime Priority Utilization T C P U a b c Another example Process Set The combined utilization is 0.82 (or 82%) This is above the threshold for three processes (0.78) and, hence, this process set fails the utilization test

15 Example time-line Time Process a b c 10 Process Release Time Process Completion Time Deadline Met Process Completion Time Deadline Missed Executing Preempted

16 Example Gantt Chart cbacb Time

17 Schedulability (3): Response time analysis Consider a worst-case scenario: – –Every process is released at the same moment – –Will they all meet their deadlines? – –i.e. is the worst-case response time (completion time) for each process <= its deadline?

18 Release of process (nominal start time) Time Deadline a b i Interference from higher priority processes, I i Units of execution End of process execution iii -> response time, R i =C i +I i c i execution time C i = a + b +c With preemptive fixed priority scheduling the only reason we aren’t actually running (given assumptions)

19 Response time analysis (1) Necessary and sufficient – –D <= T (i) R i = C i +I i – –R i = response time – –C i = worst case execution time – –I i = interference (ii) R i = C i +SUM j (ceil(R i /T j )*C j ) – –where j : P j >P i – –ceil(R i /T j ) = max. number of times that process j released in time during i

20 Response time analysis (2) Solve by: – –w i (0) = Ci – –w i (n+1) = C i +SUM j (ceil(w i (n) /T j ) *C j ) where j : P j >P i From highest priority to lowest – –until converges Schedulable iff – –R i <= D i

21 For example: Process set – –Proc.TCDP ––15231––15231 ––24122––24122 Process 2: – –w 2 (0) = C 2 = 1 – –R 2 = w 2 (0) = 1

22 R 2 < D 2 ! Process 1: – –w 1 (0) = C 1 = 2 – –w 1 (1) = C 1 +ceil(w 1 (0) /T 2 )*C 2 = 3 – –w 1 ( 2) = C 1 +ceil(w 1 (1) /T 2 )*C 2 = 3 – –R 1 = w 1 (2) = 3 – –R 1 < D 1 ! Schedulable!

23 Past paper questions 2004 Q2, 2003 Q2, 2002 Q3, 2001 Q4, 2000 Q2.

24 Run-time feasibility testing in RTSJ RTSJ Scheduler may implement run-time feasibility checking – –Default PriorityScheduler just assumes any process set without aperiodic processes is feasible Scheduler manages a “feasibility set” of Schedulable s – –i.e. RealtimeThread s and AsyncEventHandler s – –To which any schedulability analysis is applied Scheduler abstract class and Schedulable interface include various methods for checking feasibility and conditionally changing parameters…

25 Scheduler class (part) package javax.realtime; public abstract class Scheduler {` … protected boolean addToFeasibility(Schedulable s); protected boolean removeFromFeasibility(Schedulable s); public boolean isFeasible(); public boolean setIfFeasible(Schedulable s, ReleaseParameter r, MemoryParameters m, ProcessingGroupParameters g); … } Now feasible?

26 Schedulable class (part) package javax.realtime; public interface Schedulable extends Runnable { … public boolean addIfFeasible(); public boolean addToFeasibility(); public boolean removeFromFeasibility(); public boolean setIfFeasible( SchedulableParameters s, ReleaseParameter r, MemoryParameters m, ProcessingGroupParameters g); public boolean setSchedulingParametersIfFeasible( SchedulableParameters s); … }

27 Summary (1) Feasibility = schedulability, i.e. whether a set of processes should meet its deadlines Typically requires simplifying assumptions – –E.g. zero time context switch Simple tests based on CPU utilisation – –Total CPU requirements – –Liu & Leyland’s utilisation bound – –=> necessary or sufficient but not both

28 Summary (2) Response time analysis – –Models worst case simultaneous release of all processes – –Simple case models pre-emption by higher priority processes only – –Can be extended to consider process conflict (e.g. resource sharing) RTSJ provides an API for run-time feasibility testingRTSJ provides an API for run-time feasibility testing –In Scheduler & Schedulable –Scheduler maintains feasibility set –“Process” = Schedulable, i.e. RealtimeThread or AsyncEventHandler