Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real Time Systems Real-Time Schedulability Part I.

Similar presentations


Presentation on theme: "Real Time Systems Real-Time Schedulability Part I."— Presentation transcript:

1 Real Time Systems Real-Time Schedulability Part I

2 Schedulability (part 1) - 2 Outline  Timing Requirements  Concurrency and Scheduling  Scheduling Schemes  Notation  Rate Monotonic Algorithm  Utilization Bound Theorem  Examples

3 Schedulability (part 1) - 3 Timing Requirements Where do timing requirements come from?  Top-level (explicit) Requirements  assemble two widgets every second  jam a hostile emitter within 250 milliseconds of it being identified  Derived (implicit) Requirements  precision: track emitter position to within 5 °  leads to periodicity  dependability: recover from message loss within 500 msec  user-interface: respond to key press within 200 msec

4 Schedulability (part 1) - 4 Concurrency and Scheduling  concurrent systems are said to exhibit extreme non-determinism  consider a simple 5 task concurrent system  there are 120 possible execution permutations for a non-preemptive system and an infinite number for a preemptive system  real-time systems must restrict this non- determinism via scheduling  define schedulability as the assessment as to whether tasks will meet their deadlines

5 Schedulability (part 1) - 5 Scheduling Schemes  a scheduling scheme provides:  an algorithm for the use of system resources  a way of predicting the worst case behaviour  there are two classifications of schemes  static (compile-time) and dynamic (run-time)  we will only study static schemes and in particular, preemptive priority-based schemes  schemes involve:  a priority assignment algorithm; and  a schedulability test

6 Schedulability (part 1) - 6 Notation  C:worst-case computation time of the task  T: minimum time between task releases (period)  P: priority assigned to the task  N:number of tasks in the system  R: worst-case response time of the task  B:worst-case blocking time of the task  I:interference time of the task  Define Utilization: U = C/T

7 Schedulability (part 1) - 7 Define a Simple Task Model  Assumptions:  fixed set of tasks  all tasks are periodic  tasks are completely independent*  all system overheads (context switching) are ignored (or included in task computation times)  task deadlines are equal to their periods  implies that tasks must complete before next release  all tasks have a fixed worst-case execution time  Critical instant - defined as the maximum load condition when all tasks release together

8 Schedulability (part 1) - 8 Rate Monotonic Algorithm (RMA)  a priority assignment scheme for the simple task model described above such that:  each task is assigned a priority based upon its period, wherein  the shorter the period, the higher the priority  Example: TaskPeriod (T)Priority (P) A 100 3 B 25 1* highest C 205 4 D 60 2

9 Schedulability (part 1) - 9 Utilization Bound Theorem  a set of N independent periodic tasks scheduled by the rate monotonic algorithm will always meet its deadlines, if C 1 /T 1 + … C N /T N  N(2 1/N - 1) = U RM (N) U RM (N) converges to 69% at large N  a sufficient but not necessary test  i.e. we cannot say that a system with higher utilization is not schedulable with this scheduling algorithm

10 Schedulability (part 1) - 10 RMA Example 1 TaskC i T i U i A 201000.2 B301500.2 C602000.3 U 1 + U 2 + U 3 = 0.7, and is  U RM (3) where U RM (3) = 3*(2 1/3 - 1) = 0.779 Therefore these tasks will always meet their deadlines under the scheduling scheme: P(A) = 1, P(B)=2, P(C)=3

11 Schedulability (part 1) - 11 RMA Example 1 t C B A 20 30 50 20 10 30 idle 040801006020120140160180200 - task released - task complete TaskCi TiUi A201000.2 B301500.2 C602000.3

12 Schedulability (part 1) - 12 TaskC i T i U i A 12500.24 B10400.25 C10300.33 U 1 + U 2 + U 3 = 0.82, and is not  U RM (3) where U RM (3) = 3*(2 1/3 - 1) = 0.779 Therefore these tasks fail the utilization test, and by examination of their Gantt chart, it can be seen that all deadlines will not be met RMA Example 2

13 Schedulability (part 1) - 13 RMA Example 2 t C B A 020405030106070 10 - task released - task complete 10 x x - missed deadline... 10 TaskCi TiUi A12500.24 B10400.25 C10300.33

14 Schedulability (part 1) - 14 RMA Example 3 TaskC i T i U i A 4080 0.5 B10400.25 C 5200.25 U 1 + U 2 + U 3 = 1.00, and is not  U RM (3) again where U RM (3) = 3*(2 1/3 - 1) = 0.779 These tasks clearly fail the utilization test, but after examination of their Gantt chart, it can be seen that all deadlines will be met ????

15 Schedulability (part 1) - 15 RMA Example 3 t C B A 020405030106070 5 - task released - task complete 5 15 80 555 5 10 15 TaskCiTiUi A4080 0.5 B10400.25 C 5200.25

16 Schedulability (part 1) - 16 Additional Points on RMA  RMA has the advantage of being stable in conditions of transient overload  a subset of the tasks (those with the highest priorities) will still meet their deadlines even in a temporary overload condition.  Completion Time Theorem  for a set of independent periodic tasks, if each task meets its first deadline when all tasks are started at the same time, then the deadlines will be met every time.

17 Schedulability (part 1) - 17 Weaknesses of RMA and U Test  utilization test is not exact  sufficient, but not necessary  therefore other tests must be used (besides manually checking the timelines)  the simple task model is too restrictive  only allows for periodic tasks  all tasks must be independent  implies no shared resources (no mutexes)  introduce  Response Time Analysis - a stronger schedulability test  supports aperiodic (sporadic) tasks as well as dependence

18 Schedulability (part 1) - 18 References [1] Burns, A. and Wellings, A., “Real-Time Systems and Programming Languages”, Chapter 13, Addison Wesley, 1997 [2] TimeSys Corp, “The Concise Handbook of Real-Time Systems”, Version 1.0, 1999 [3] www.timesys.com [4] Gomaa, H., “Software Design Methods for Concurrent and Real-Time Systems”, Addison- Wesley, 1993.


Download ppt "Real Time Systems Real-Time Schedulability Part I."

Similar presentations


Ads by Google