05s_schedulability_part2

Upload: kannan-karuppiah

Post on 04-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 05s_schedulability_part2

    1/11

    Utilization based schedulability tests

    pros: usually involves a simple computational test

    mathematically rigorous

    Seminal paper

    cons: not always conclusive

    sufficient but not necessary

    only valid if the workload model and the underlyingassumptions of the test are consistent can lead to false confidence

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    2/11

    Alternatives

    When utilization based tests are inconclusive, we canalways construct a timing graph of the system construct graph over the interval [0, max {pi}]

    if all tasks meet their deadlines within their first period,the system is schedulable

    assumes that all tasks are in phase

    the problem with this approach is that it will be impracticalfor most large systems and is not easily automated

    As experienced in the first homework alternative: time-demand analysis

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    3/11

    Revisiting Critical Instants

    Recall that a critical instant is defined as the instantin time that a job is released such that it has themaximum response time of all jobs in the task think of it as the worst possible time (busiest) to release on

    the processor

    Theorem: in a fixed priority system (where every job ina task completes before another job in the same task releases),the critical instant for Ti occurs when it releases at

    the same time as a job in each higher priority task

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    4/11

    Critical Instants

    Example 1: T= { (3,1), (5, 1), (10, 2) }

    The critical instant for tasks T2 and T3 is 0

    0 2 4 6 12

    T1

    T2

    T3

    8 10

    1

    1

    1

    1 1 1

    1 1

    1 1

    In fact for in phase tasks, a critical instant always exists at t = 0

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    5/11

    Critical Instants

    Example 2: T= { (1,3,1,3), (5, 1), (10, 2) }

    The critical instant for tasks T2 and T3 is 10

    0 2 4 6 12

    T1

    T2

    T3

    8 10

    1

    1

    1

    1 1 1

    1 1

    1 1

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    6/11

    Understanding Response Time

    T = { (100, 20), (150, 30), (250, 60) }

    w3 = e3 + w3/p1 e1 + w3/p2 e2

    = 60 + 2(20) + 1(30) {by viewing the graph}

    = 130

    0 100 200

    T1

    T2

    T3

    w3 = 130

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    7/11

    Solving the Response Time Equation

    Essentially, form a recursive relationship withequation (5) and solve iteratively:

    win+1 = ei + wi

    n / pj ej (6)

    where initial (seed) value wi0 = ei

    The algorithm then becomes:

    solve for successive values of win+1

    if win+1 = win , then solution found -> wi = win

    if win+1 > Di , then task i cannot meet its deadline

    jhp(i)

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    8/11

    Exercise

    Draw the schedule for the system below (go out far enough in time to include as a minimum the

    completion of the first job in each periodic task and allaperiodic jobs)

    Determine the response time of A1 Determine the worst case response time of all

    periodic tasks

    Is the system schedulable? T={ (5, 1.5), (7, 2) }

    TDS = ( 4, 1) , A = {(0.5, 2.5), (2.5, 0.25)}

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    9/11

    Exercise Solution

    draw the schedule for the system belowT={ (5, 1.5), (7, 2) }

    TDS = ( 4, 1) , A = {(0.5, 2.5), (2.5, 0.25)}

    Tasks

    T2

    T1

    TDS

    6 8 t0 2 4

    A1 A1 A1A

    2

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    10/11

    Exercise Solution

    determine the response time of A1wA1 = 8.5 - 0.5 = 8

    wA2 = 8.75 - 2.5 = 6.25

    determine the worst case response time of allperiodic tasks

    w11 = e1 + es + (w1

    0-es) / ps es where w10 = 1.5

    = 1.5 + 1 + (1.5 -1) / 4 (1) = 3.5

    w12 = 2.5 + (3.5 -1) / 4 (1) = 3.5

    therefore w1 = 3.5 D1 (worst-case)

    11/6/2012 Dr Alain Beaulieu

  • 7/31/2019 05s_schedulability_part2

    11/11

    Exercise Solution

    determine the worst case response time of allperiodic tasks (continued)

    w21 = e2 + es + (w20-es) / ps es + (w20) / p1 e1 w20 = 2

    = 2 + 1 + (2 -1) / 4 (1) + 2 / 5 (1.5) = 5.5

    w22 = 3 + (5.5 -1) / 4 (1) + 5.5 / 5 (1.5) = 8

    w23 = 3 + (8 -1) / 4 (1) + 8/ 5 (1.5) = 8

    therefore w2 = 8 > D2 (worst-case)

    is the system schedulable?No since all tasks do not meet their deadlines under worst-caseconditions, we can not guarantee the system schedulable

    11/6/2012 Dr Alain Beaulieu