160 likes | 306 Views
CprE 458/558: Real-Time Systems. Resource Reclaiming (Contd.). Restriction Vector (RV) Algorithm. Scheduler computes RV for each task in the pre-run schedule. RV depends on resource and/or precedence constraints and the pre-run schedule.
E N D
CprE 458/558: Real-Time Systems Resource Reclaiming (Contd.) CprE 458/558: Real-Time Systems (G. Manimaran)
Restriction Vector (RV) Algorithm • Scheduler computes RV for each task in the pre-run schedule. • RV depends on resource and/or precedence constraints and the pre-run schedule. • Processor checks the RV of the task before starts executing it. The RV algorithm says: start executing a task Ti only if processor on which Ti is scheduled is idle and all the tasks in its restriction vector have finished their execution. CprE 458/558: Real-Time Systems (G. Manimaran)
Understanding the notation: T<i T<1= {T2,T5,T6,T7} T<1(1) = {T6} T<1(2) = {T2,T7} T<1(5) = {T5} T1 P1 T6 T9 P2 T2 T7 T8 P3 T3 P4 T4 P5 T5 T10 CprE 458/558: Real-Time Systems (G. Manimaran)
Understanding the notation: T>i T>1= {T3,T9} T1 P1 T6 T9 P2 T2 T7 T8 P3 T3 P4 T4 P5 T5 T10 CprE 458/558: Real-Time Systems (G. Manimaran)
Understanding the notation: T~i T~1= {T4,T8,T10} T1 P1 T6 T9 P2 T2 T7 T8 P3 T3 P4 T4 P5 T5 T10 CprE 458/558: Real-Time Systems (G. Manimaran)
RV Definition • Each task Ti has an associated m-component vector, RVi[1..m], called the Restriction Vector, where m is the number of processors. • RVi[j] for a task Ti contains the last task in T<i(j) which must be completed before the execution of Ti begins. CprE 458/558: Real-Time Systems (G. Manimaran)
RV Definition (Contd.) • Where denoting the set of tasks that are scheduled (in the pre-run schedule) to finish before Tistarts. • RV Migration Algorithm: Swaps dispatch queues of two processors when original RV algorithm is not able to reclaim. . CprE 458/558: Real-Time Systems (G. Manimaran)
RV Algorithm -- Example CprE 458/558: Real-Time Systems (G. Manimaran)
RV Example (Contd.) CprE 458/558: Real-Time Systems (G. Manimaran)
RV Migration Algorithm CprE 458/558: Real-Time Systems (G. Manimaran)
Accounting the cost of reclaiming • Algorithm overhead must be accounted as part of the WCET of the task • Higher the complexity (cost) of reclaiming algorithm, the lesser the “hole” seen by it for reclaiming • Let WCET, ACET of task Ti be 10 and 8, respectively • Let the WCET of Basic, Early start, RV, and RV-migration algorithms be 1, 2, 2, and 3, respectively • Assume we are evaluating these four algorithms • Overall, WCET’ of task Ti is 10 + Max(1,2,2,3) = 13 • When Ti finishes executing (before invoking reclaiming), the holes seen by Basic, Early start, RV, and RV-migration algorithms will be 4 (=13-(8+1), 3, 3, and 2 respectively • Employing more complex reclaiming algorithm does not necessarily increase the resource reclaimed CprE 458/558: Real-Time Systems (G. Manimaran)
Effect of actual to worst-case computation CprE 458/558: Real-Time Systems (G. Manimaran)
Effect of Worst-case Computation Time CprE 458/558: Real-Time Systems (G. Manimaran)
Basic idea of passing Resource constraints T6 R T6 cannot execute in this hole, since it has resource constraints with T2 However T1 can execute at time = 0 T2 T1 P1 T6 T9 P2 T2 T7 T8 time = 0 CprE 458/558: Real-Time Systems (G. Manimaran)
Basic idea of passing T2 Precedence constraints T6 cannot execute in this hole, since it has precedence constraints with T2 However T1 can execute at time = 0 T6 T1 P1 T6 T9 P2 T2 T7 T8 time = 0 CprE 458/558: Real-Time Systems (G. Manimaran)
Reclaiming algorithms -- properties • Basic, Early Start, RV, and RV-migration • Passing is not allowed -- this helps to avoid run-time anomaly • Bounded complexity – depends on fixed parameters (#processors, RV-check-const, mig-attempt, etc.) • Algorithm overhead must be included as part of the WCET of the task • Employing more complex reclaiming algorithm does not necessarily increase the resource reclaimed CprE 458/558: Real-Time Systems (G. Manimaran)