Top Banner

of 16

10 RM DM Scheduling of Periodic Tasks

Jun 02, 2018

Download

Documents

bevan678
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    1/16

    PriorityPriority- -driven Scheduling ofdriven Scheduling ofperiodic tasks: RM and DMperiodic tasks: RM and DM

    OUTLINE

    Fixed-priority algorithms for scheduling periodic tasks- Optimality of RM?- Optimality of DM?- U lub for 2 tasks with RM- U lub for n tasks with RM

    1

    Ref: [Liu] Ch. 6 (pg. 129 131; 146 152)

    Optimality of RM?Optimality of RM? We have already seen that fixed-priority scheduling algorithms are

    not optimal for periodic tasks with arbitrary periods However RM is o timal in the s ecial case when:

    - tasks are simply periodic (for every pair of tasks one period ismultiple of the other),

    - relative deadlines D i are not shorter than the periods p i We will prove this in the following slide (theorem). Notations:

    2

    -T i has priority higher than T k if i < k .

    - Ti denotes the subset of tasks with priority equal or higher than T i(Ti ={T 1, T 2 , T i })

    - Ui =k=1 to i u k =k=1 to i e k / p k is the total utilization of Ti

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    2/16

    First optimality of RMFirst optimality of RM Theorem : A system of independent preemptable simply periodic tasks

    with relative deadlines equal to or larger than their periodsis feasible in one processor with RM algorithm iff its total

    . Proof : only-if: obvious ; if: if the task set is not feasible, then U > 1

    - assume T i misses its deadline at time t ; let t =0 be the last instantbefore t when processor idles or executes jobs with priority < T i ;

    - we assume D k = p k for any k = 1, .. i : if a system is feasible whenD k = p k for any k , it is feasible also when D k > p k for some k ;

    -

    3

    k , ,

    total time required to complete all jobs with deadline d t :k=1 to i e k (t / p k ) = t k=1 to i e k / p k = t Ui

    - if T i misses its deadline, then the above time exceeds theavailable time t : t Ui > t

    Ui > 1

    Critical instantsCritical instants in a fixed priority task set with D i p i , a critical instant for task T k is the time at

    which the release of one of its jobs will produce the largest response time w k it is easy to realize that a critical instant for task T k occurs when one of its

    T k T i

    T k alone:w k1 = e k

    T k and T i :

    T k

    w k,1 = e k + 3e i w k,2 = e k + 4e i

    J k,1 J k,2

    4

    - the response time w k,1 of a job J k,1 is delayed by the interference of ahigher priority task T

    i(in the bottom figure, jobs of T

    idelay w

    k,1by 3e

    i)

    - when the release time of J i,y gets closer to the release time of J k,x (e.g.J i,5 and J k,2 ), the delay may increase ( 4e i for J k,2 )

    - the response time of J k,x is maximum when the 2 release times coincide- repeat the argument for all tasks T j ( j =1, 2, k-1 )

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    3/16

    Second optimality of RMSecond optimality of RM Theorem : If a task set with p i = D i can be feasibly scheduled by a fixed

    priority algorithm then it can be feasibly scheduled by RM. Proof :

    . o s o a as s are eas e a e r cr ca ns an s, en ey arefeasible in any other conditions; so we consider the (worst case)critical instants

    2. consider a set of 2 periodic tasks T 1 and T 2 with p 1 < p 2 : if prioritiesare not assigned according to RM, then T 2 has the higher priority:

    T 2 e 2 e 1

    p 2

    5

    from the figure it is easy to see that, at critical instants, the scheduleis feasible iff e 1 + e 2 p 1

    3. we now will prove that if this condition holds, then the 2 tasks areschedulable also with RM

    w 1T 1 p 1

    Second optimality of RM (2)Second optimality of RM (2) we prove that if e 1 + e 2 p 1, then the 2 tasks are schedulable also with RM:

    - let us invert the priorities of the 2 tasks so that they respect the RM rule(p 1 < p 2 and T 1 has now the higher priority);

    - 1,1 1 2,1 2

    T 1

    T 2 e 2

    w 1 = e 1 p 1

    p 2

    w 2

    - the response time w 1 of J 1,1 is shorter than in the previous case ( J 1,1 is notdela ed b T if J did not miss its deadline in the revious case it will

    6

    , not miss it now;

    - since e 1 + e 2

    p 1 the response time w 2 of J 2,1 is equal to e 1 + e 2 (J 2,1 isdelayed by one and only one job of T 1: since e 1 + e 2 p 1, the release ofthe second job of T 1 occurs after J 2,1 has completed);

    - then w 2 = e 1 + e 2 p 1 < p 2 J 2,1 will not miss its deadline;- the 2 tasks are feasible; the result can be extended to n tasks.

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    4/16

    Optimality of RM whenOptimality of RM when D D i i >p >p ii ? ? Problem : If a task set with D i > p i can be feasibly scheduled by a fixed priority

    algorithm, then can it be feasibly scheduled by RM?or can it be feasibly scheduled by DM?

    The answer in NO to both questions, as proven by the following example:T 1: (9, 3, 10) ; T 2 : (6, 4, 8) U = 3/9 + 4/6 = 1

    - the system is feasible with fixed priority T 1 > T 2 :

    T 19 18

    d 1,1 d 1,2

    T 2 12 146 7 8 18

    d 2,3 d 2,1 d 2,2 r 2,2 r 2,1 r 2,3

    J 1,1 J 1,2

    J 2,1 J 2,2 J 2,3

    r 1,1 r 1,2

    7

    - with RM or DM (priority T 2 > T 1) the system is not feasible :here J 1,1 misses its deadline

    T 19 18

    d 1,1 d 1,2

    T 2 12 146 7 8 18

    d 2,3 d 2,1 d 2,2 r 2,2 r 2,1 r 2,3

    r 1,1 r 1,2 J 1,2 J 1,1

    J 2,3 J 2,2 J 2,1

    Optimality of RM and DM?Optimality of RM and DM? we have already seen that fixed-priority scheduling algorithms are not

    optimal for tasks with arbitrary periods; we have also seen that:

    1. RM is optimal in the special case when tasks are simply periodicand relative deadlines D i are not shorter than periods p i ;

    2. RM is optimal among fixed-priority algorithms when relativedeadlines D i are equal to periods p i ;

    in the general case, fixed priority RM and DM algorithms are noto timal, nevertheless the are often used because the lead to more

    8

    predictable and stable systems;

    among all the fixed priority algorithms , DM is the best because it isoptimal also when relative deadlines are shorter than periods.

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    5/16

    Optimality of DMOptimality of DM Theorem : If a task set with D i p i can be feasibly scheduled by a fixed

    priority algorithm then it can be feasibly scheduled by DM. Proof :

    . a as s are eas e a e r cr ca ns an s, en ey are eas ein any other conditions; so we consider the (worst case) criticalinstants

    2. consider a set of 2 periodic tasks T 1 and T 2 with D 1 < D 2 : if prioritiesare not assigned according to DM, then T 2 has the higher priority:

    T 2 e 2 e 1

    D 2 p 2

    9

    from the figure it is easy to see that, at critical instants, theschedule is feasible iff e 1 + e 2 D 1

    3. we now will prove that if this condition holds, then the 2 tasks areschedulable also with DM

    w 1T 1 D 1 p 1

    Optimality of DM (2)Optimality of DM (2) we prove that if e 1 + e 2 D 1, then the 2 tasks are schedulable also with DM:

    - let us invert the priorities of the 2 tasks so that they respect the DM rule(D 1 < D 2 and T 1 has now the higher priority);

    - lets consider the obs J T and J T startin at a critical instant:w 2

    T 1

    T 2 e 2

    w 1 = e 1 D 1

    D 2 p 2

    p 1

    , ,

    - the response time w 1 of J 1,1 is shorter than in the previous case ( J 1,1 is notdelayed by T 2 ) if J 1,1 did not miss its deadline in the previous case, it will

    10

    - since e 1 + e 2 D 1 the response time w 2 of J 2,1 is equal to e 1 + e 2 (J 2,1 is

    delayed by one and only one execution of T 1: since e 1 + e 2 D 1 p 1, thesecond job of T 1 is released after J 2,1 has completed);

    - then w 2 = e 1 + e 2 D 1 < D 2 J 2,1 will not miss its deadline;- the 2 tasks are feasible; the result can be extended to n tasks.

    why this is not true for RM? suppose D 2

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    6/16

    U U lub lub for 2 tasks with RMfor 2 tasks with RM

    To compute the least upper bound U lub of the processor utilization factorfor a set of 2 periodic tasks T 1 and T 2 , with D i = p i , scheduled by the RM

    ,1. we assume p 1 < p 2 : according to RM, T 1 has the higher priority;

    2. we compute the upper bound U ub of their utilization factor by settingexecution times e 1 and e 2 to fully utilize the processor;

    3. we minimize the upper bound U ub by adjusting all other parametersof the 2 task (essentially their periods or, more precisely, as we will

    11

    see, the ratio between their periods).

    U U lub lub for 2 tasks with RM (2)for 2 tasks with RM (2)- let F = p 2 /p 1 be the number of periods of T 1 entirely contained in p 2 ;- we consider the 2 cases:

    case 1 : all jobs of T 1 released in the first period of T 2 starting from a criticalinstant, are completed within the first period of T 2 ; that is: Fp 1 + e 1 p 2

    - in this situation, the largest possible value of e 2 for which the system isfeasible is: e 2MAX = p 2 - (F + 1)e 1 (with e 2 =e 2MAX the tasks fully utilize the pr.)

    - the corres ondin U is:

    e 1T 1

    T 2

    p 1

    p 2 J 1,l

    12

    U ub = (e 1 / p 1) + (e 2MAX / p 2 ) (U ub varies with e 1)U ub = (e 1 / p 1) +1 - ( F + 1)e 1 / p 2 = 1+ ( e 1 / p 2 ) [(p 2 / p 1) - (F + 1)]

    - since [( p 2 / p 1) - (F + 1)] is negative, U ub decreases with e 1 and is minimumwhen e 1 has its maximum value

    - since Fp 1 + e 1 p 2 , the maximum value of e 1 is e 1MAX = p 2 - Fp 1- U ub is minimum when e 1 = p 2 - Fp 1 (when job J 1,l completes at t = p 2 )

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    7/16

    U U lub lub for 2 tasks with RM (3)for 2 tasks with RM (3)case 2 : the execution of the last job of T 1 (J 1,l ) released in the first periodof T 2 overlaps the release of the second job of T 2 ; that is: Fp 1 + e 1 > p 2

    T 2 p 2

    - in this situation, the largest possible value of e 2 for which the system isfeasible is: e 2MAX = Fp 1 - Fe 1 (with e 2 =e 2MAX the tasks fully utilize the proc.)

    - the corresponding U ub is:U ub (e 1 / p 1) + (e 2MAX / p 2 ) (U ub varies with e 1)U = e / + F - e / = e / + F / - Fe /

    T 1 p 1 e 1

    J 1,l

    13

    U ub = (Fp 1 / p 2 ) + (e 1 / p 2 )[(p 2 / p 1) - F ]- since [( p 2 / p 1) - F ] is positive, U ub increases with e 1 and is minimum whene 1 has its minimum value

    - since Fp 1 + e 1 > p 2 , the minimum value of e 1 is e 1MIN = p 2 - Fp 1- U ub is minimum when e 1 = p 2 - Fp 1- in both cases U ub is minimum when J 1,l terminates exactly at p 2

    U U lub lub for 2 tasks with RM (4)for 2 tasks with RM (4)- in both cases U ub is minimum when e 1 = p 2 - Fp 1 (J 1,l terminates exactly at p 2 )- using this value of e 1, the expression of U ub becomes:

    U ub = (Fp 1 / p 2 ) + (e 1 / p 2 )[(p 2 / p 1) - F ] = (Fp 1 / p 2 ) + [(p 2 - F p 1) / p 2 ][(p 2 / p 1) - F ]U = / + / - / - F

    we note that U ub is expressed as a function of the ratio k = p 2 / p 1U ub (k ) = [F + (k - F )2 ]/ k

    - to simplify the expression, let G = (p 2 / p 1) - F (G = k - k ) we note that 0 G < 1 and that G = 0 when p 2 is a multiple of p 1. then we may write:

    U ub = (p 1 / p 2 )[F + G 2 ]U = + G 2 / / = + G 2 / / - F + F

    14

    U ub = (F + G 2 ) /(G + F ) = [F + G - (G - G 2 )]/(F + G )U ub = 1 - [( G - G 2 ) /(F + G )] = 1 - [G (1 - G ) /(F + G )]

    - since G (1 - G ) is non negative, U ub increases with F and is minimum when F has its minimum value , i.e. when F = 1

    - when F =1, we have: U ub = (1 + G 2 ) /(1 + G ) (expressed as a function of G)- we will now find the minimum of the function U ub (G )

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    8/16

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    9/16

    U U lub lub for 2 tasks with RM (7)for 2 tasks with RM (7)- to get a deeper insight into the problem , we may examine the expression

    of U ub as a function of the ratio k = p 2 / p 1:U ub (k ) = [F + (k - F )2 ] /k = (F + k 2 + F 2 - 2kF ) /k = (k 2 - 2kF + F + F 2 ) /k

    ub = - + +- the following figure represents the upper bound of U as a function of k :

    U ub as a function of k = p 2 / p 1

    0,9

    1

    1,1

    U ub

    Uub

    17

    ub = - + +when k is integer, k = F andU ub (k ) = k - 2k + k (k + 1)/ k ,

    U ub (k ) = 10,6

    0,7

    ,

    1 2 3 4 5 6 7 8 9 10

    k = p 2 /p 1

    U U lub lub for 2 tasks with RM (8)for 2 tasks with RM (8)- lets now find the values of k that produce the local minima of U ub (k ) for any

    given value of F :U ub (k ) = k - 2F + F (F + 1) / k

    2 ubdU

    ub / dk = 0 (and U

    ub (k ) is minimum) for k* = [F (F + 1)] ,

    - for any given value of F , the corresponding minimum value of U is:U* = 2( [F (F + 1)] - F )

    - the following table contains the first few values of k * for which the processorutilization has a local minimum U *

    F k* U*

    18

    1 2 0.828

    2 6 0.8993 12 0.928

    4 20 0.9445 30 0.954

    Values of k * and U * as a function of F = p 2 / p 1

    k* = [F (F + 1)]U* = 2( [F (F + 1)] - F )

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    10/16

    U U lub lub for n tasks with RMfor n tasks with RM Theorem : A set of n indipendent, preemptable, periodic tasks with D i = p i

    can be feasibly scheduled on a processor with the RM algorithmif its total utilization U is not greater than:

    1/ n

    -RM Proof (informal):we will try to construct a set of n tasks that fully utilize the processorand whose total utilization U is the smallest among all sets of n tasksthat fully utilize the processor;we call period ratio of the set of n tasks: q n,1 = p n / p 1in the first part of the proof we show that for any task set with period

    19

    ratio q n,1

    > 2 that fully utilizes the processor (with total utilization U ) acorresponding set of n tasks may be found, with period ratio q n,1 2,that fully utilizes the processor with total utilization U < U ;as a consequence, in constructing the task set with the smallest U, wemay consider only task sets with period ratio q n,1 2, i.e. with p n 2p 1.

    U U lub lub for n tasks with RM (2)for n tasks with RM (2)first part of the proof :

    for any task set with period ratio q n,1 > 2 that fully utilizes the processor(with total utilization U ) there is a corresponding set of n tasks, with

    eriod ratio 2 that full utilize the rocessor with total utilization, U < U :

    starting from any set of n task with period ratio q n,1 > 2 that fullyutilize the processor, we will step by step construct another set of n task with period ratio q n,1 2 and with a lower total utilization;

    for any task T k whose period p k is such that lp k

    2.

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    11/16

    U U lub lub for n tasks with RM (3)for n tasks with RM (3)

    T k p k 2p k (l-1)p k lp k

    e k

    e n0 (l+1)p k

    the new T k has period lp kand execution time e k ,

    T n p n

    T k p k = lp k

    e n = e n+ (l-1)e k

    e k = e k

    0

    0

    21

    n nand exec. time e n + ( l-1)e k by construction:

    - T k and T n use the same amount of processor time used by T k and T n ;- p n 2p k (p n /p k 2);- U - U = e k /p k - e k / lp k - (l- 1) e k /p n = (1 / lp k - 1 /p n )(l- 1) e k- U - U > 0 since lp k < p n

    n

    p n = p n0

    U U lub lub for n tasks with RM (4)for n tasks with RM (4)second part of the proof :we consider only the case: p n 2p 1

    - we will tr to construct a set of n tasks that full utilize the rocessorand whose total utilization U is the smallest among all sets of n tasks

    that fully utilize the processor;- starting from a critical instant, if p n 2p 1, in the feasible interval of the

    lowest priority job J n,1 (0 p n ), each one of the other n -1 higher prioritytasks ( T 1, .. T n-1 ) will release 2 jobs;

    - starting from a critical instant, the task set must keep the processor

    22

    n n,1 all the other 2( n -1) jobs of higher priority tasks released before p n :

    then the task set is feasible and fully utilizes the processor;

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    12/16

    U U lub lub for n tasks with RM (5)for n tasks with RM (5)- a possible schedule that is feasible and fully utilizes the processor is

    the one in the figure below; the relationships between periods andexecution times satisfy the equations ( ) :

    other equalities:

    e k = p k+1 - p k for k =1, 2, , n -1

    e n = p n - 2 k=1 to n-1 e k

    1p 1 2p 1

    T 2 p 2

    T 3 p 3

    23

    p 1 = k=1 to n e k p n - p 1 = k=1 to n-1 e k e n = 2p 1 - p n

    - we will show that such a schedule, that satisfies the equations ( ), hasthe minimum U among all schedules that fully utilize the processor.

    T n-1p n-1

    T n p n

    U U lub lub for n tasks with RM (6)for n tasks with RM (6) a different schedule that is feasible and fully utilizes the processor, but

    with periods and execution times that do not satisfy equations ( ), maybe obtained modifying the schedule by increasing or decreasing theexecution time of one of the tasks.

    lets first increase (WLOG) the

    execution time of T 1 (see fig.):e 1 = e 1 + = p 2 - p 1 + - this increment would cause

    all jobs of all lower prioritytasks to start execution timeunits later than in the originals stem as a result J would

    T 1p 1 2p 1

    T 2 p 2

    T 3 p 3

    + +

    24

    ,not terminate at p 1: itsremaining execution timecould be resumed only attime p n + , beyond itsdeadline;

    T n-1p n-1

    T n p n

    T k

    p k

    preemption missed deadline

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    13/16

    U U lub lub for n tasks with RM (7)for n tasks with RM (7)- to keep the new system schedulable, the execution time of some other

    task T k must be reduced by the same amount (see figure):e k = e k - = p k+1 - p k -

    - the remaining tasks in this newsystem still satisfy equations ( )

    - it is easy to see that the totalutilization U of this new systemis greater than the totalutilization U of the original

    T 1p 1 2p 1

    T 2 p 2

    T 3 p 3

    + +

    25

    system:

    U -U = e 1/p 1+ e k /p k - e 1 /p 1- e k /p k U -U = /p 1 - /p k > 0 since p 1 < p k T n-1

    p n-1

    T n p n

    T k p k

    - -

    U U lub lub for n tasks with RM (8)for n tasks with RM (8) lets now decrease (WLOG) the execution time of T 1 (see figure):

    e 1 = e 1 - = p 2 - p 1 - - this decrement would cause the first jobs of all lower priority tasks to

    start execution time units earlier than in the ori inal s stem

    - as a result J n,1 would terminateat p 1 - and the processorwould then remain idle for time units before startingexecution of J 1,2 at t = p 1;

    - the processor would remain

    T 1p 1 2p 1

    T 2 p 2

    T 3 p 3

    - -

    26

    from the instant at which J 1,2

    completes (at t = p 2 -

    ) towhen J 2,2 is released (at p 2 );

    - in the time interval (0 - p 2 ) thetotal idle time would be 2 .

    T n-1p n-1

    T n p n

    T k

    p k

    processor idle

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    14/16

    U U lub lub for n tasks with RM (9)for n tasks with RM (9)- to keep the processor fully utilized in the new system, the execution time

    of some other task T k must be incremented by the same amount 2 :e k = e k + 2 = p k+1 - p k + 2

    - the remaining tasks in this newsystem still satisfy equations ( );

    - it is easy to see that also thetotal utilization U of this newsystem is greater than the totalutilization U of the original

    T 1p 1 2p 1

    T 2 p 2

    T 3 p 3

    - -

    27

    system:

    U - U = e 1/p 1+ e k /p k - e 1 /p 1- e k /p k U - U = 2 /p k - /p 1U - U > 0 since p k 2p 1

    T n-1p n-1

    T n p n

    T k p k

    + 2 + 2

    U U lub lub for n tasks with RM (10)for n tasks with RM (10) we have proved that the sets of n tasks whose parameters satisfy

    equations ( ) (and p n 2p 1) have the minimum processor utilization U (n )among all task sets of n tasks that do not satisfy ( ); lets express U (n )as a function of ratios between eriods of the tasks = / : , ,

    U (n ) = k=1 to n e k /p k = k=1 to n-1 [e k / p k ]+ e n / p n {apply equations ( )}U (n ) = k=1 to n-1 [(p k+1- p k )/ p k ] + (p n -2 k=1 to n-1 e k )/ p n U (n ) = k=1 to n-1 [p k+1 /p k - p k / p k ] + 1 - (2 / p n )k=1 to n-1 (p k+1- p k )U (n ) = k=1 to n-1 [p k+1 /p k -1] + 1 - (2 / p n )(p n - p 1)U (n ) = k=1 to n-1 (q k+1,k ) - (n -1) + 1 - 2 (p n - p 1)/ p n U n = - - n + 2 - - /

    28

    - , U (n ) = k=1 to n-1 (q k+1,k ) - n + 2(1 - (p n - p 1)/ p n )

    U (n ) = k=1 to n-1 (q k+1,k ) - n + 2 p 1 / p n U (n ) = k=1 to n-1 (q k+1,k ) - n + 2/( p n / p 1) {p n / p 1=(p n / p n-1 )(p n-1 / p n-2 )(p 2 / p 1)}U (n ) = q 2,1 + q 3,2 + q n,n-1 - n + 2/( q 2,1 q 3,2 q n,n-1 )

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    15/16

    U U lub lub for n tasks with RM (11)for n tasks with RM (11) when p n 2p 1, the utilization ( U (n )) of a set of n tasks that satisfy ( ) is

    a function of the ratios between adjacent periods p k+1 / p k :U (n ) = q 2,1 + q 3,2 + q n,n-1 - n + 2/( q 2,1 q 3,2 q n,n-1 )

    s s a symme r ca unc on o e n - a acen per o ra os svalues are the same for any permutation of its n -1 variables); lets compute its second partial derivative for any one of its variables: U (n )/ q k+1,k = 1 - 2(q 2,1 q k,k-1 q k+2,k+1 q n,n-1 )/(i=1 to n-1 (q i+1,i ))2

    U (n )/ q k+1,k = 1 - 2/(q 2,1 q k,k-1 (q k+1,k )2 q n,n-1 ) 2U (n )/ 2q k+1,k = 2(q 2,1 q k,k-1 2q k+1,k q n,n-1 )/((q k+1,k )2 i=1 to n-1 (q i+1,i ))2

    2 2

    29

    k+1,k the second partial derivative is greater than zero: U (n ) is a symmetrical convex function of q k+1,k (k =1, 2, n -1) U (n ) has a unique minimum and this minimum is the schedulable

    utilization of RM for a set of n tasks: U lub (n ) = U RM(n ) U (n ) is minimum when q k+1,k is such that U (n )/ q k+1,k = 0

    U U lub lub for n tasks with RM (12)for n tasks with RM (12) to find the value of U RM(n ) we must find the values of its variables q k+1,k

    (k =1, 2, n -1) for which all its partial derivatives are zero; since ( U (n )) is a symmetrical function of its n -1 variables, its minimum is

    reached when all its n -1 variables have the same value for which itspartial derivatives are zero:

    the partial derivative with respect to the generic variable q k+1,k is: U (n )/ q k+1,k = 1 - 2/(q 2,1 q k,k-1 (q k+1,k )2 q n,n-1 )

    when all q i+1,i are equal to q k+1,k : U (n )/ q k+1,k = 1 - 2/(q k+1,k )n

    this partial derivative is zero when k+1 k = 21/ n

    30

    the corresponding minimum value of U (n ) [q 2,1+ q 3,2 + q n,n-1 - n + 2/( q 2,1q 3,2 q n,n-1 )] is:

    U RM(n ) = (n -1)21/ n

    - n + 2/2(n -1)/ n

    U RM(n ) = n 21/ n - 21/ n - n + 2(2 (1-n )/ n ) = n 21/ n - 21/ n - n + 2 1+(1- n )/ n

    U RM(n ) = n 21/ n - 21/ n - n + 2 (n +1- n )/ n = n 21/ n - 21/ n - n + 2 1/ n = n 21/ n - n U RM(n ) = n (21/ n - 1)

  • 8/11/2019 10 RM DM Scheduling of Periodic Tasks

    16/16

    - we have seen that the expression that gives U RM for 2 tasks:URM (2) = 2(2 1/2 - 1)

    can be extended to the case of n task: URM (n ) = n (21/ n - 1)

    U U lub lub for n tasks with RM (13)for n tasks with RM (13)

    - t s rat er easy to see next s e t at:when n , URM (n ) = ln 2 ( 0.693)

    - the following table and figure give an idea of the values of URM (n ) :

    n URM (n)

    1 1.000 11,1

    31

    2 0.8283 0.780

    4 0.757

    5 0.743 0.693

    0,6

    0,7

    0,8

    0,9

    1 2 3 4 5 6 7 8 9 1 0 11 12 13 1 4 15 16 17 18 19 20

    n

    Urm(n)

    0.693

    U U lub lub for n tasks with RM (14)for n tasks with RM (14)URM (n ) = n (21/ n - 1)

    lets substitute: y = (2 1/ n - 1): =n

    1/ n = log 2(y +1) = ln (y +1) / ln 2 (recall: log

    z x = l n x / l n z )

    n = ln 2 / ln (y +1)

    URM (n ) = ny = y ln 2 / ln (y +1)

    lim n URM (n ) = lim y 0 [y ln 2 / ln (y +1)] = ln 2 lim y 0 [y / ln (y +1)] =

    (recall: derivative of ln : ln x = 1 / x )

    lim y 0 [y / l n (y +1)] = lim y 0 1 / [1 / (y +1)] = lim y 0 (y +1) = 1

    lim n URM (n ) = ln 2