Download presentation
Presentation is loading. Please wait.
Published byAlexia Nelson Modified over 9 years ago
1
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi
2
CS3204 Spring 2006 3/3/06 2 Real-Time Systems Systems that must service requests within a precise time constraint: Air traffic control systems Railway switching systems Industrial automation Robotics Military Generally, systems that must respond to external physical phenomena.
3
CS3204 Spring 2006 3/3/06 3 Tracking System Example Dynamic trajectory calculations False alarms Verification System response Real-time clock 687m error!
4
CS3204 Spring 2006 3/3/06 4 System Resources Different approaches to resource management: General-purpose OS Extensible time horizon: all tasks eventually finish Similarly, elastic memory: demand paging Fairness Non-starvation Real-Time system Fixed resources Tasks adjusted accordingly Predictability
5
CS3204 Spring 2006 3/3/06 5 Schedulers Preemptive / non-preemptive Static / dynamic On-line / off-line Optimal / heuristic Clairvoyance
6
CS3204 Spring 2006 3/3/06 6 Real-Time Task Parameters CiCi aiai didi sisi fifi t Arrival time Computation time start time finish time deadline
7
CS3204 Spring 2006 3/3/06 7 Real-Time Tasks CiCi aiai didi sisi fifi t CiCi aiai didi sisi fifi t Laxity (slack) Deadline miss x
8
CS3204 Spring 2006 3/3/06 8 RMA Rate Monotonic Algorithm Static Preemptive Fixed-priority assignment Periodic tasks Guarantee-based Hard real-time correctness – all deadlines always met
9
CS3204 Spring 2006 3/3/06 9 RMA (continued) RMA: Assign unique priorities, in descending order, to tasks ordered by ascending periods: the shorter the period, the higher the priority.
10
CS3204 Spring 2006 3/3/06 10 RMA – Example TaskTCP A51 B C A 5010152025 Assume deadline equals period (T).
11
CS3204 Spring 2006 3/3/06 11 RMA – Example TaskTCP A51 B93 C A 5010152025 B
12
CS3204 Spring 2006 3/3/06 12 RMA – Example TaskTCP A51 B93 C122 A 5010152025 B C
13
CS3204 Spring 2006 3/3/06 13 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
14
CS3204 Spring 2006 3/3/06 14 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
15
CS3204 Spring 2006 3/3/06 15 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
16
CS3204 Spring 2006 3/3/06 16 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
17
CS3204 Spring 2006 3/3/06 17 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C A preempts C
18
CS3204 Spring 2006 3/3/06 18 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
19
CS3204 Spring 2006 3/3/06 19 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
20
CS3204 Spring 2006 3/3/06 20 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C A preempts B
21
CS3204 Spring 2006 3/3/06 21 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C C arrives
22
CS3204 Spring 2006 3/3/06 22 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
23
CS3204 Spring 2006 3/3/06 23 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
24
CS3204 Spring 2006 3/3/06 24 RMA – Example TaskTCP A513 B932 C1221 A 5010152025 B C
25
CS3204 Spring 2006 3/3/06 25 RMA (continued) How far can we push this? Constraints Number of tasks? Periods? Computational times?
26
CS3204 Spring 2006 3/3/06 26 Processor Utilization Factor Fraction of CPU time spent in execution of tasks: Otherwise stated: sum of the individual relative load contribution of each task in the task-set. Provides an indication of system-wide computational load.
27
CS3204 Spring 2006 3/3/06 27 Feasibility Test RMA guarantee: No deadlines will be missed under rate monotonic scheduling if the following condition holds:
28
CS3204 Spring 2006 3/3/06 28 Feasibility Test (continued) Note that: That is, any task-set with a CPU utilization factor of 69% or less is schedulable under RMA Sufficient, but not necessary condition
29
CS3204 Spring 2006 3/3/06 29 Optimality RMA is an optimal fixed-priority assignment algorithm: no other fixed- priority algorithms can schedule a task set that cannot be scheduled under RMA.
30
CS3204 Spring 2006 3/3/06 30 EDF Earliest Deadline First Earlier the deadline, higher the priority. Dynamic assignment On-line No periodicity assumptions – can schedule aperiodic tasks.
31
CS3204 Spring 2006 3/3/06 31 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C Hyper-period
32
CS3204 Spring 2006 3/3/06 32 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C
33
CS3204 Spring 2006 3/3/06 33 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C
34
CS3204 Spring 2006 3/3/06 34 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C Lexical order tie breaker
35
CS3204 Spring 2006 3/3/06 35 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C
36
CS3204 Spring 2006 3/3/06 36 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C
37
CS3204 Spring 2006 3/3/06 37 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C
38
CS3204 Spring 2006 3/3/06 38 EDF – Example TaskTC A41 B84 C123 5010152025 Assume deadline equals period (T). A B C Pattern repeats
39
CS3204 Spring 2006 3/3/06 39 EDF Properties Feasibility test: U = 100% in example Bound theoretical Sufficient and necessary Optimal
40
CS3204 Spring 2006 3/3/06 40 Overload Hard real-time No deadlines misses. Dimension system to meet exact timing requirements. Soft real-time May encounter transient or sustained overload. Design algorithm to achieve desired temporal behavior.
41
CS3204 Spring 2006 3/3/06 41 Real-Time Overload Scheduling Runtime uncertainty Dynamic system Aggregate demand exceeds capacity Fixed available bandwidth Must shed load Starvation Who survives?
42
CS3204 Spring 2006 3/3/06 42 EDF Domino Effect X X X Cascading deadline misses Deadline sole scheduling parameter
43
CS3204 Spring 2006 3/3/06 43 Load Shedding Feasible schedule if any task excluded in example? Selection criteria Fitness metric Second dimension: utility
44
CS3204 Spring 2006 3/3/06 44 Load Shedding X X X Overload detected
45
CS3204 Spring 2006 3/3/06 45 Load Shedding X X X Least valuable task u = 3 u = 1 u = 5 u = 7 Two scheduling parameters: deadline and utility
46
CS3204 Spring 2006 3/3/06 46 Load Shedding X Least valuable task u = 3 u = 1 u = 5 u = 7
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.