16
CprE 458/558: Real-Time Systems (G. Manimaran) 1 CprE 458/558: Real-Time Systems Resource Reclaiming (Contd.)

CprE 458/558: Real-Time Systems

  • Upload
    nami

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 1

CprE 458/558: Real-Time Systems

Resource Reclaiming (Contd.)

Page 2: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 2

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.

Page 3: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 3

Understanding the notation: T<i

T<1= {T2,T5,T6,T7}

T1

T2

T4

T5

T3

P1

P2

P3

P4

P5

T6

T7 T8

T9

T10

T<1(1) = {T6}

T<1(2) = {T2,T7}

T<1(5) = {T5}

Page 4: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 4

Understanding the notation: T>i

T>1= {T3,T9}

T1

T2

T4

T5

T3

T6

T7 T8

T9

T10

P1

P2

P3

P4

P5

Page 5: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 5

Understanding the notation: T~i

T~1= {T4,T8,T10}

T1

T2

T4

T5

T3

T6

T7 T8

T9

T10

P1

P2

P3

P4

P5

Page 6: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 6

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.

Page 7: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 7

RV Definition (Contd.)

• Where denoting the set of tasks that are scheduled (in the pre-run schedule) to finish before Ti starts.

• RV Migration Algorithm: Swaps dispatch queues of two processors when original RV algorithm is not able to reclaim.

.

Page 8: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 8

RV Algorithm -- Example

Page 9: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 9

RV Example (Contd.)

Page 10: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 10

RV Migration Algorithm

Page 11: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 11

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

Page 12: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 12

Effect of actual to worst-case computation

Page 13: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 13

Effect of Worst-case Computation Time

Page 14: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 14

Basic idea of passing

T1

T2

T6

T7 T8

T9P1

P2

R

T6

T2

T6 cannot execute in this hole, since

it has resource constraints with

T2

However T1 can execute at time =

0

time = 0

Resource constraints

Page 15: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 15

Basic idea of passing

T1

T2

T6

T7 T8

T9P1

P2

T6

T2

T6 cannot execute in this hole, since it has precedence constraints with

T2

However T1 can execute at time =

0

time = 0

Precedence constraints

Page 16: CprE 458/558: Real-Time Systems

CprE 458/558: Real-Time Systems (G. Manimaran) 16

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