Cpr E 458558 RealTime Systems Dynamic Planning Based
Cpr. E 458/558: Real-Time Systems Dynamic Planning Based Scheduling Cpr. E 458/558: Real-Time Systems (G. Manimaran) 1
The big picture Cpr. E 458/558: Real-Time Systems (G. Manimaran) 2
Planning based scheduling approach • A planning based approach will evaluate different possible schedules for a given task set and chooses a final feasible schedule which satisfies all the constraints • Ideally, one should evaluate all the possible schedules before choosing the final schedule. • However, the number of possible schedules for a reasonable number of tasks is huge. Therefore, all the possible schedules in the search space cannot be evaluated Cpr. E 458/558: Real-Time Systems (G. Manimaran) 3
Scheduler model Cpr. E 458/558: Real-Time Systems (G. Manimaran) 4
Scheduler model (contd. ) • Schedulability checking (on-line) – by the scheduler • Schedule construction (on-line) – by the scheduler • Dispatching & Resource reclaiming – by the processors; each processor runs reclaiming algorithm when it finishes a task execution. Sched-check at a most opportune time (punctual point) – Too early: tend to reject tasks because reclaiming may not be exploited fully – Too late: if rejected, the application has no time to take any recovery action Cpr. E 458/558: Real-Time Systems (G. Manimaran) 5
Task set model • Planning based scheduler assumes worst case computation time for each task • Planning based scheduler performs nonpreemptive scheduling Cpr. E 458/558: Real-Time Systems (G. Manimaran) 6
Planning based scheduling: search space • The search space for the planning based scheduling consists of different possible schedules for the given task set • A typical planning based scheduler will prune the search space by exploring different schedules and choose a final feasible schedule based on a heuristic function Cpr. E 458/558: Real-Time Systems (G. Manimaran) 7
Search space: example Aperiodic Task set: Ti = (ri, ci, di) Different possible schedules T 1 = (0, 2, 8) and T 2 = (1, 5, 6) Schedule #1 T 2 2 0 6 7 8 Schedule #2 T 2 1 T 1 6 7 8 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 8
Spring/Myopic Scheduling Algorithm • Notations/Jargon – EATSK = earliest available time when resource Rk becomes available for shared access – EATe. K = earliest available time when resource Rk becomes available for exclusive access – Avail_time(j) = earliest time at which the processor Pj becomes available for executing a task – EST(Ti) = Max(ri, min(avail_time(j)), max(EATUK) ) Cpr. E 458/558: Real-Time Systems (G. Manimaran) 9
Understanding EST: Example R 1 Time = 10 P 1 Tx Time = 5 Arrival of tasks Ti Time = 3 EST(Ti) = max(3, 5, 10) = 10 Cpr. E 458/558: Real-Time Systems (G. Manimaran) 10
Definitions • Feasible task: – A task Ti is feasible in a schedule if its timing constraint and resource requirements are met in the schedule, that is, if – EST(Ti) + Ci ≤ Di. • Feasible schedule: – A schedule for a set of tasks is said to be a feasible schedule if all the tasks are feasible in the schedule. Cpr. E 458/558: Real-Time Systems (G. Manimaran) 11
Definitions (contd. . ) • Strongly feasible schedule: – A partial schedule for a subset of tasks. A partial schedule is said to be strongly feasible if all the schedules obtained by extending the current schedule by any one of the remaining tasks within a window, called the feasibility check window K are also feasible. Cpr. E 458/558: Real-Time Systems (G. Manimaran) 12
Spring/Myopic Scheduling Algorithm Heuristic search algorithm based on a notion of strong feasibility. Branch & Bound search. 1. Sort the “n” tasks in deadline order. 2. Check for strong feasibility for K tasks which are in the feasibility check window. (i. e. , Check if EST(Ti) + Ci <= di) 3. If the current vertex is strongly feasible – Compute heuristic value Hi = di + W * EST(Ti) – Choose the best (smallest) H value, let it be Hx. – Extend the schedule with task Tx. Cpr. E 458/558: Real-Time Systems (G. Manimaran) 13
Spring/Myopic Scheduling (contd. ) 4. Else Backtrack to the previous vertex, Extend the schedule with next best task. 5. Repeat steps 2 -4 until either: – Feasible schedule is obtained. – Maximum backtracks reached. – No more backtracking is possible. Algorithm Complexity: O(Kn + Backtracks). Exhaustive search algorithm: O(m^n) where m: # processors; n: # tasks. Cpr. E 458/558: Real-Time Systems (G. Manimaran) 14
Myopic scheduling: Example Task Id Ready time WCET Deadline R 1 usage R 2 usage T 1 0 28 80 S N T 2 0 24 73 N E T 3 14 39 95 E E T 4 5 25 89 S N T 5 35 21 108 N S Ordered by their deadlines T 2 T 1 T 4 T 3 T 5 Feasibility check window, K=3 Assume, w = 1 H 2 = 73 + 0 H 1 = 80 + 0 H 4 = 89 + 5 H 3 == 89 95 ++ 24 24 H 3 = 95 + 28 H 5 = 108 H 3 = 95++35 49 H 5 = 108 + 35 T 3 on P 1 Search Tree (0, 0) (24, 28) (49, 28) (88, 28) Cpr. E 458/558: Real-Time Systems (G. Manimaran) Strongly feasible T 2 on P 1 T 1 Strongly on T 5 P 2 on P 2 Strongly feasible Strongly T 4 feasible on P 1 Strongly feasible T 3 on P 1 (49, 56) (95, 56) NOT Strongly feasible 15
Myopic scheduling: Example Search Tree (0, 0) (24, 0) T 1 on P 2 (24, 28) P 2 P 1 T 2 on P 1 T 4 on P 1 T 5 on P 2 (49, 28) (49, 56) (88, 28) (95, 56) T 3 on P 1 T 5 28 35 T 2 56 T 4 24 T 3 49 56 95 Feasible schedule obtained using Myopic algorithm Cpr. E 458/558: Real-Time Systems (G. Manimaran) 16
- Slides: 16