Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPE555A: Real-Time Embedded Systems

Similar presentations


Presentation on theme: "CPE555A: Real-Time Embedded Systems"— Presentation transcript:

1 CPE555A: Real-Time Embedded Systems
Lecture 6 Ali Zaringhalam Stevens Institute of Technology Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology 1

2 Outline Scheduling Earliest-Due-Date (EDD)
Earliest-Deadline-First (EDF) Latest Deadline First (LDF) Rate Monotonic Scheduling (RMS) CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 2 2

3 The Scheduling Problem
Input A set of n tasks Γ = {τ1, τ2, , τn}, A set of m processors P = {P1, P2, , Pm} A set of s types of resources R = {R1,R2, , Rs} Constraints: timing (deadline), precedence Output Assigning processors from P and resources from R to tasks from Γ in order to complete all tasks under the specified constraints This problem, in its general form, has been shown to be computationally intractable To make the problem of constructing feasible schedules tractable, certain assumptions are made CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 3 3

4 Scheduling Classification - 1
Preemptive The running task can be interrupted at any time to assign the processor to another active task, according to a predefined scheduling policy Non-preemptive A task, once started, is executed by the processor until completion. All scheduling decisions are taken when the current task terminates its execution CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 4 4

5 Scheduling Classification - 2
Static Scheduling decisions are based on fixed parameters (e.g. priority), assigned to tasks before their activation Dynamic Scheduling decisions are based on dynamic parameters (e.g. priority) that may change during task execution CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 5 5

6 Scheduling Classification - 3
Off-line All tasks are known at start & never change The scheduling algorithm is executed on the entire task set before task activation The schedule is stored in a table and later executed by a dispatcher On-line Tasks can arrive at run time The scheduling decisions are taken at runtime every time a new task enters the system or when a running task terminates CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 6 6

7 Scheduling Classification - 4
Optimal An optimal schedule minimizes some given cost function defined over the task set If there is no cost function, then the only concern is to achieve a feasible schedule meeting deadlines An algorithm is said to be optimal with respect to feasibility if it is able to find a feasible schedule, if one exists Heuristic Uses a heuristic approach in taking its scheduling decisions A heuristic algorithm tends toward the optimal schedule, but does not guarantee finding it CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 7 7

8 Guarantee-Based Algorithms
A dynamic scheduler with real-time deadline and admission control A new task arrives The task is accepted only if the deadlines of current tasks are unaffected CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 8 8

9 Example Scheduler Metrics
CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 9 9

10 Earliest Due Date (EDD)
Jackson’s algorithm A set of n aperiodic tasks A single processor Optimization metric Minimizing maximum lateness Lmax=Maxi(fi-di) Designation: 1 | sync | Lmax sync means that tasks arrive “synchronously”, at the same time Each task can have a different computation time and deadline But they all arrive at the same time CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 10 10

11 EDD Algorithm No random task arrival. All tasks arrive at the same time. Given a set of n independent tasks, any algorithm that executes the tasks in order of non-decreasing deadlines is optimal with respect to minimizing the maximum lateness Because all tasks arrive at the same time, preemption is not an issue The static priority assigned to each task is the deadline: the shorter the deadline, the higher the priority We can assume that all tasks arrive at t=0 Each task is characterized by computation time and deadline (C,d) CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 11 11

12 Proof of EDD Suppose there was a non-EDD schedule S. There must be two tasks a and b where a immediately precedes b but da > db. Why? The schedule can be improved to reduce maximum lateness by interchanging a and b No non-EDD schedule can do better in minimizing maximum lateness The complexity of the EDD algorithm is O(nxlogn): the complexity of the sorting algorithm Because if there were no such instance, then the schedule would be EDD. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 12 12

13 EDD & Non-EDD Schedules
Note that fj=f’i because tasks execute consecutively Non-EDD Non-EDD: i finishes earlier but has a later deadline than j. In this example both fi-di and fj-dj are negative. EDD Two cases for possible value of L’max: L’max = f’i – di = fj-di <= fj – dj L’max = f’j – dj <= fj – dj The non-EDD Lmax = fj-dj So in both cases L’max <= Lmax So EDD is no worst than non-EDD Tasks are scheduled as soon as the CPU is available. There is no preemption. A task runs to completion. If the schedule is feasible, all deadlines are met and fi-di is negative for all i. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 13 13

14 Example 1 J1 J2 J3 J4 J5 fi 1 8 4 7 3 di 10 5 Li -2 -3 -1
J4 has maximum lateness = -1 Queue J2 J4 J3 J5 J1 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 14 14 Dequeue

15 EDD & Feasibility EDD produces a schedule which minimizes maximum lateness But it may not be a feasible schedule in the sense of meeting all deadlines So EDD cannot be relied upon to obtain a feasible schedule meeting all deadlines But if there does exist a feasible schedule, then EDD can find it From any feasible schedule you can use EDD to obtain another feasible schedule which minimizes maximum lateness Complexity of EDD O(nlogn) – A heap sorting algorithm CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 15 15

16 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Example 2 J1 J2 J3 J4 J5 fi 1 4 2 10 6 di 5 8 Li -1 -2 Deadline missed Queue J4 J5 J2 J3 J1 Dequeue CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 16 16

17 Dynamic Run-Time Scheduler
The scheduler lets a task to continue to completion before scheduling another task There is no timer interrupt The scheduler is invoked by the ISR or the OS service call invoked by the user CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 17 17

18 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Typically a lower numerical value represents a higher priority By user Or by the scheduler to prevent starvation of lower-priority tasks Tasks are switched in and out when the timer interrupt kicks in and invokes the scheduler . A non-preemptive priority-based scheduler allows a task to complete. The next task to run is determined by priority. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 18 18

19 Earliest Deadline First (EDF)
Horn’s algorithm N independent tasks with arbitrary arrival time. Tasks are not synchronous Preemption is allowed 1 | preemp | Lmax Optimization metric is the same as in EDD Minimizing maximum lateness Lmax=Maxi(fi-di) CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 19 19

20 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
EDF Algorithm Given a set of n independent tasks with arbitrary arrival times, any algorithm that at any instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness. Complexity O(n2) if ready queue is a linear list O(nlogn) if the ready queue is implemented as a heap CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 20 20

21 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
EDF Proof At time t=4, the executing task J4 has a deadline of td=15. s(t)=arrival time; s(tE)=execution time. Task J2 arrives at t=4. The scheduler rethinks the existing schedule and makes changes. This is a non-EDF feasible schedule Maximum lateness is Lmax=0 associated with J1 Preemption is allowed: so break up time in slices. Tasks can execute in disjointed intervals Interchanging the execution of J4 and J2 at t=4 does not increase maximum lateness CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 21 21

22 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
EDF Proof - Continued After the interchange the resulting schedule is also feasible because the deadline of J4 is after the deadline associated with J2. Interchange the execution of J2 and J4 at t=4. Maximum lateness remains the same at L=0 for J1 Continue this in all time slices CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 22 22

23 Example Completed tasks None CS555A – Real-Time Embedded Systems
Both J1 and J2 arrive at t=0. J1 is scheduled first because its deadline is (d1=2) < (d2=5). Completed tasks None CS555A – Real-Time Embedded Systems Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 23 23

24 Example - Continued Completed tasks J1
J3 arrives at t=2. J3 has a deadline of d3=4 whereas the currently executing task J2 has a deadline of d2=5. Because d3 < d2, J2 is preempted and J3 is dispatched for execution. Completed tasks J1 preemption CS555A – Real-Time Embedded Systems Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 24 24

25 Example - Continued Completed tasks J1
J4 arrives at t=3. Its deadline is d4=10. The earliest deadline is still d3=4. So J3 remains in execution. No preemption at t=3. Completed tasks J1 CS555A – Real-Time Embedded Systems Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 25 25

26 Example - Continued Lmax = 0 Completed tasks J1 J2 J3
J5 arrives at t=6. Its deadline is d5=9. which is earlier than the d4=10 of J4 which is currently executing. So J4 is preempted and J5 is dispatched. Lmax = 0 Completed tasks J1 J2 J3 preemption CS555A – Real-Time Embedded Systems Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 26 26

27 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Some Observations A schedule is computed at t=0 based on the ready tasks The schedule is re-examined only when a new task arrives You can view the task with the earliest deadline as having the highest priority If a feasible schedule (one that meets all deadlines) exists, EDF will find it. It also has the minimum lateness However an EDF schedule is not necessarily feasible (may not meet deadlines) CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 27 27

28 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz 28 28

29 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
After task 1, task 4 has the earliest deadline but it cant’ be scheduled because it has a dependency on task 2 which must be scheduled first. So task 3 is the first EDF task meeting dependency requirements that can be scheduled. NO. Task 1: meets deadline d=2 Task 2: meets deadline d=5 Task 3: meets deadline d=4 Task 4: does NOT meet deadline d=3 Task 5: meets deadline d=5 Task 6: meets deadline d=6 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 29 29

30 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz 30 30

31 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
LDF assumes a fixed, finite set of tasks with deadlines. No arrival of new tasks. No preemption. 6 Stack Push What’s nice about a leaf node is that no other task is dependent on it. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 31 31

32 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz 32 32

33 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 33 33

34 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 34 34

35 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
3 5 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 35 35

36 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
4 3 5 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 36 36

37 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
2 4 3 5 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 37 37

38 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Stack Pop 1 2 4 3 5 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 38 38

39 The complexity of LDF is O(n2).
So it is also optimal with respect to feasibility. Why? The complexity of LDF is O(n2). CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 39 39

40 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz 40 40

41 EDF With Precedence Assume all tasks arrive at ai=ri=0
All tasks require execution time ci=1 r4=0 c4=1 d4=3 r2=0 c2=1 d2=5 4 2 r5=0 c5=1 d5=5 5 r1=0 c1=1 d1=1 1 Rule of thumb for this strategy: the deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. 3 r6=0 c6=1 d6=6 6 r3=0 c3=1 d3=4 CS555A – Real-Time Embedded Systems Stevens Institute of Technology ej is extecution time of task j 41 41

42 Timing Definitions - Continued
/ri Start time si is the time at which a task starts its execution Finishing time fi is the time at which a task finishes its execution Response time Ri is the difference between the finishing time and the request time: Ri = fi − ri Lateness: Li = fi −di represents the delay of a task completion with respect to its deadline; note that if a task completes before the deadline, its lateness is negative Laxity or Slack time: Xi = di − ai − Ci is the maximum time a task can be delayed on its activation to complete within its deadline Xi = di − Ci when ai=0 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 42 42

43 EDF With Precedence Start with i=1 Tasks immediately depending on 1
d2-c2=4 d3-c3=3 d1’=min(1, min(4,3))=1 r2=0 c2=1 d2=5 r4=0 c4=1 d4=3 4 2 r5=0 c5=1 d5=5 5 r1=0 c1=1 d1’’=1 1 r3=0 c3=1 d3=4 3 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 Rule of Thumb:The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. r6=0 c6=1 d6=6 6 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 43 43

44 EDF With Precedence Next select i=2 with d2=5
Tasks immediately depending on 2 D(2) = {4, 5} d4-c4=2 d5-c5=4 d2’=min(5, min(2,4))=2 r2=0 c2=1 d2’’=2 r4=0 c4=1 d4=3 4 2 r5=0 c5=1 d5=5 5 r1=0 c1=1 d1’’=1 1 r3=0 c3=1 d3=4 3 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 Rule of Thumb:The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. r6=0 c6=1 d6=6 6 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 44 44

45 EDF With Precedence Next select i=3 with d3=4
Tasks immediately depending on 3 D(3) = {6} d6-c6=5 d3’=min(4, min(5))=4 r2=0 c2=1 d2’’=2 r4=0 c4=1 d4=3 4 2 r5=0 c5=1 d5=5 5 r1=0 c1=1 d1’’=1 1 r3=0 c3=1 d3’=4 3 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. r6=0 c6=1 d6=6 6 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 45 45

46 EDF With Precedence The remaining nodes are leaf nodes. No other task depends on them So their deadlines remain unchanged r2=0 c2=1 d2’’=2 r4=0 c4=1 d4’=3 4 2 r5=0 c5=1 d5’=5 5 r1=0 c1=1 d1’’=1 1 r3=0 c3=1 d3’=4 3 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. r6=0 c6=1 d6’=6 6 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 46 46

47 EDF With Precedence Now apply normal EDF: Task 1 Task 2 Task 4 Task 3
5 r1=0 c1=1 d1’’=1 1 r3=0 c3=1 d3’=4 3 r6=0 c6=1 d6’=6 6 EDF with precedence rationalizes deadlines. Instead of accepting the given deadline, the algorithm ensures that the assigned “virtual” deadlines take into account deadlines of successor. A task cannot have a later deadline than the minimum slack of its successors. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 47 47

48 Optimality EDF with precedence is optimal in the sense of minimizing maximum lateness A schedule obtained may not be feasible Tasks may not meet their deadline But if a feasible schedule exists, EDF with precedence will find it. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz 48 48

49 Periodic Tasks T A periodic task is a sequence of jobs that are released at times 0+fi, Ti +fi, 2 Ti +fi, … A periodic task ti is specified using the parameters Ti – period Ci – maximum execution time fi– phase or offset (almost always zero) Di – relative deadline (almost always Ti) CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

50 Sporadic Tasks Sporadic tasks are characterized by a minimum inter-arrival time, rather than a fixed period (the earliest, the task arrives again) Minimum spacing is necessary to ensure execution within C (maximum execution time) Many of the analysis for periodic tasks apply to sporadic tasks if Ti is interpreted as the minimum time between arrivals CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

51 Scheduling Points Scheduling point is where the scheduler must examine the schedule and make scheduling decisions This includes preemption of the currently running task For periodic tasks, the scheduler kicks in at the fixed period For sporadic tasks, the scheduler kicks in when tasks arrive CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

52 Scheduling Assumptions - 1
The instances of a periodic task ti are regularly activated at a constant rate. The interval Ti between two consecutive activations is the period of the task All instances of a periodic task ti have the same worst-case execution time Ci All instances of a periodic task ti have the same relative deadline Di which is equal to the period Ti What’s relative deadline? CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

53 Scheduling Assumptions - 2
All tasks in the task set are independent; that is, there are no precedence relations and no resource constraints No task can suspend itself, for example on I/O operations All tasks are released as soon as they arrive (ai=ri) All context-switching overheads are assumed to be zero CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

54 Hyperperiod Or Major Cycle
A periodic system schedule can be defined by giving a finite-length schedule that is repeated over and over. The length of the smallest such schedule is called the hyperperiod for that task set For a purely periodic task set, the hyperperiod is given by the Least Common Multiple of the periods Hyperperiod = LCM(Ti) for all i CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

55 Harmonic Task Set A periodic task set is harmonic if
Every period evenly divides all larger periods Every period is evenly divisible by all smaller periods The hyperperiod of a harmonic task set is equal to the largest task period (because it is the LCM!) Example: three tasks with periods 25, 50 and 100 100/50=2; 100/25=4; 50/25=2 100:50:25 = 4:2:1 Hyperperiod: 100 Scheduling algorithms may be simpler and more efficient for harmonic task sets CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

56 Timeline Scheduling Time Line Scheduling
It is an off-line static scheduling strategy Divide the time line into time slices for scheduling purposes Use the Greatest Common Divisor of the Task Periods as the time slice This is the same as the smallest period in a harmonic task set It is referred to as the Minor Cycle CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

57 Example Three tasks with periods 25, 50, 100
Hyperperiod Must be scheduled every 25 units. Must be scheduled every 50 units. Must be scheduled every 100 units. Three tasks with periods 25, 50, 100 Hyperperiod/Major cycle (LCM): 100 Time slice/minor cycle (GCD) : 25 A feasible schedule exists if CA+CB < 25 CA+CC < 25 These are sufficiency conditions. They are not necessary conditions (i.e., there may be feasible solutions even if these conditions are not met. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

58 Timeline Scheduling Notes
Advantage: design simplicity A timer interrupts every “minor cycle” A table-driven scheduler executes programs in the order computed in the major cycle Disadvantage: Could cause instability during CPU overload if a task does not terminate at the minor-cycle boundary Difficult to maintain a static schedule when task periods or execution times change CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

59 Rate-Monotonic Scheduling
Assume n tasks running periodically Periods: T1, T2,….Tn Worst-case execution time: C1, C2,….Cn Relative deadline (relative to release time) Di = Ti No precedence constraints Preemptive with fixed/static priorities Theorem: if any static priority assignment yields a feasible schedule, then priorities ordered by period (smallest period has the highest priority) also yields a feasible schedule CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

60 Optimal Feasibility Optimality with respect to feasibility means: if there is a feasible schedule S, then RMS can also schedule it If RMS executes every task to completion once within its designated period, then it satisfies the feasibility objective There may be other feasible schedules that are not RMS CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

61 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz

62 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz

63 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz

64 finish The scheduler kicks in whenever a task arrives
Note that if we make the red task longer, at some point the blue task may not be able to complete within C1 and misses its deadline. In this case there is no feasible RMS solution. finish The scheduler kicks in whenever a task arrives at its periodic interval. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

65 The worst-case processor demand occurs when all tasks are released simultaneously. This is referred to as the critical instant. The response time is longest. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

66 RMS solution: T2 has a higher priority
We have two tasks RMS solution: T2 has a higher priority Non-RMS solution: which task has a higher priority? CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

67 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
With only two tasks, the non-RMS schedule is the one where the blue task with the longer period has a higher priority. So we have to only consider feasible non-RMS scheduling scenarios. CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

68 CS555A – Real-Time Embedded Systems Stevens Institute of Technology
Spring 2015, arz

69 Comments The proof can be extended to an arbitrary number of tasks
The proof is for optimality with respect to feasibility. Other optimality criteria such as processor utilization are not considered. In fact RMS schedulers cannot always achieve 100% utilization. RMS is essentially a preemptive scheduling algorithm with fixed priority given by the task period Spring 2015, arz

70 What Have We Shown? We have shown that in cases where there exists a feasible scheduling solution under conditions stated in the theorem, the RMS scheduling algorithm also works RMS is optimal in the sense that it yields a feasible solution when there exists a feasible solution under any strategy This is called: optimality with respect to feasibility CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

71 What Have We Shown? If C1+C2>T2, a non-RMS solution does not exist in the two-task example RMS does not have to satisfy this constraint Therefore it can cover more than non-RMS solutions But there may be cases where there is no feasible solution. In these cases RMS can’t help either. Examples: Suppose in the two-task example, the period of the longer task is shorter CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz

72 Example: Infeasible RMS Schedule
time processing period ) , ( = i C T P Deadline Miss 1st run 2nd run 3rd run ) 1 , 4 ( = P 1st run 2nd run ) 2 , 5 ( = P 1st run 1st run ) 2 , 7 ( 3 = P 5 10 15 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz


Download ppt "CPE555A: Real-Time Embedded Systems"

Similar presentations


Ads by Google