slack_jwlee

Document Sample
slack_jwlee Powered By Docstoc
					“Scheduling with Dynamic Voltage/Speed Adjustment
             Using Slack Reclamation
      In Multi-processor Real-Time Systems”
             Dakai Zhu, Rami Melhem, and Bruce Childers
                    Computer Science Department
                       University of Pittsburgh




                       Presented by Jin W. Lee
                            October, 2001



                                                          1
                 Outline


1. Task Model and Problem Description
2. Energy Model and Power Management
3. Power aware scheduling for independent tasks
4. Power aware scheduling for dependent tasks
5. Conclusion




                                                  2
           Task Model and Problem Description

- Ti = (ci, ai)
   ci is the task’s worst case execution time (WCET) based on full CPU speed
   ai is actual case execution time (ACET)

- Problem:
   Scheduling Scheme for Multi-Processor Systems
   that Minimizes energy consumption for CPU while still meet Deadline




                                                                         3
Energy Model and Power Management

      Processor Power Dissipation
                 Pd= Cef*Vdd2* f
            - Cef is the switch capacitance
             - f is processor frequency
           -Vdd is processor supply voltage


            Processor Speed
              f = k (Vdd –Vt )2/ Vdd
                  - k is a constant
             - Vt is the threshold voltage


            Energy per Task
          E/task = Pd * t = Cef* Vdd2
           - t is the time to execute the task




                                                 4
                Basic Idea

                                 Deadline D


Smax
       Cpu time units for task
                =X


                                              t



           Cpu time units for task
                    =X



                                                  5
           Slack Reclamation Schemes



– Task’s Dynamic Behavior
 Actual Execution Time: 40% [9]
– Slack
 Unused time considered as slack and can be reused by the following tasks
 at run-time
– Reclaim Slack
 Greedy Scheme
 Shared Scheme




                                                                   6
                      Basic Scheduling Schemes
                T1=(10, 7), T2=(8,4), T3=(6,6), T4=(6,6), T5=(6,6)
     Ready Queue         T1            T2     T3     T4       T5




P1         T1      T4                                         P1         T1        T2


P2        T2     T3     T5                                    P2       T3     T4   T5


     0                       20             Time                   0                    20           Time
         LTF priority assignment                                       Optimal priority assignment



                                  P1        T1      T4


                                  P2        T2 T3        T5


                                       0                       20              Time

                                        Actual execution with max cpu speed                                 7
Example for Global Scheduling with Slack Reclamation
               for Independent Tasks

                   T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

        Ready Queue        T1      T2      T3   T4 T5 T6




   P1         T1     T4 T5                          P1       T1    T3    T5

   P2        T2     T3   T6                         P2        T2        T4 T6

        0                     9         Time             0                      9        Time

            Canonical Execution                              Actual Execution with NPM




                                                                                                8
     Global Scheduling with Greedy Slack Reclamation
  T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)



   P1       T1                                         P1       T1
                                                                          T3

   P2        T2                                        P2        T2

        0                       9          Time             0                    9           Time

                  2   3    3

                 T1        T3

We know c1 for T1 and c3 for T3
c1+c3 is the time T3 must be finished
If T3 can start time 2, we can expend execution time
                                                                P1        T1            T6
                                                                                T3
for T3 to time 7 like below graph.
                                                                P2         T2   T4 T5
                 T1
                          T3
                                                                      0                 9           Time

                                                                                 Miss Deadline !!
                                                                                                           9
 Global Scheduling with Shared Slack Reclamation
T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)




P1       T1                                       P1       T1

P2        T2                                      P2        T2

     0        2   45   9             Time              0         45      9   Time




                           P1       T1             T5
                                            T3
                           P2        T2            T6
                                             T4

                                0                       9         Time

                                             Meet Deadline !!
                                                                                    10
Global Scheduling with Shared Slack Reclamation
           Algorithm Implementation


      1    While (Ready-Q is not Empty)
      2    {
      3    Tk = Dequeue (Ready-Q);
      4    If ( STNTid > STNT~id )
      5         STNTid  STNT~id ;
      6    EETk = STNTid + ck ;
      7    STNTid = EETk;
      8    Sid = Smax * ck / ( EETk - t );
      9     Execute(Tk, Sid);
      10   }



                                              11
                       Algorithm : Example Step 1

                 T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

         Ready Queue     T1      T2     T3   T4 T5 T6


Time 0 Task 1(c1=5) dequeue
       id = 1
       STNT1 = 0, STNT2 = 0
       EET1 = 0 + 5
       STNT1 = 5
       Cpu Speed 5/(5-0)  100 %
                                               P1       T1
        Task 2(c2=4) dequeue
        id = 2                                 P2        T2
        STNT1 = 5, STNT2 = 0
        EET2 = 0 + 4                                0                9
        STNT2 = 4
        Cpu Speed 4/(4-0)  100 %

                                                                               12
                       Algorithm : Example Step 2

                 T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

         Ready Queue                         T4 T5 T6

Time 2 Task 3(c1=3) dequeue
       id = 1
       STNT1 = 5, STNT2 = 4                      P1       T1
       Switch STNT for sharing Slack !!
       STNT1 = 4, STNT2 = 5                      P2        T2
       EET3 = 4 + 3
       STNT1 = 7
       Cpu Speed 3/(7-2)  60 %                       0         4 5    9       Time



                                                 P1       T1
                                                                T3
                                                 P2        T2

                                                      0                9       Time   13
                       Algorithm : Example Step 3


                  T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)

         Ready Queue                              T5 T6

Time 4 Task 4(c1=2) dequeue
       id = 2
       STNT1 = 7, STNT2 = 5
       EET4 = 5 + 2
       STNT2 = 7                                 P1       T1
                                                                T3
       Cpu Speed 2/(7-4)  67 %
                                                 P2        T2
                                                                 T4

                                                      0                9        Time




                                                                                       14
                       Algorithm : Example Step 4

                 T1=(5, 2), T2=(4,4), T3=(3,3), T4=(2,2), T5=(2,2), T6=(2,2)
         Ready Queue


Time 7 Task 5(c1=2) dequeue
       id = 1
       STNT1 = 7, STNT2 = 7
       EET5 = 2 + 7                          P1       T1          T5
       STNT1 = 9                                            T3
       Cpu Speed 2/(9-7)  100 %
                                             P2        T2         T6
                                                             T4
        Task 6(c2=2) dequeue
        id = 2                                    0                    9        Time
        STNT1 = 9, STNT2 = 7
        EET6 = 2 + 7                                         Meet Deadline !!
        STNT2 = 9
        Cpu Speed 2/(9-7)  100 %


                                                                                       15
Example for Global Scheduling with Slack Reclamation
                for Dependent Tasks
                          (3,3)
                                  T4
          (2,2)
                             (4,4)
            T2                                  (6,6)
                                  T3
                                                    T6

           (3,1)

            T1
                                       (6,6)
                                           T5


                   Precedence Graph

                                                         16
                     List Scheduling for Dependent Tasks
      List scheduling is a standard algorithm
                         used to schedule task sets with precedence constraints

                      T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)
Worst Case Ready Time                                Actual Case Ready Time
0          2               3             6            0          1          2                   6

 T1    T2       T3    T4       T5            T6        T1    T2           T5    T3        T4        T6




      P1        T1   T4        T5                           P1 T1         T5         T6

      P2        T2   T3        T6                           P2       T2   T3   T4              Miss Deadline !!


            0                       12       Time                0                        12         Time

                Canonical Execution                                  Actual Execution with NPM

                                                                                                          17
List Scheduling with Shared Slack Reclamation
             for Dependent Tasks

      T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

              Ready Time
               0         1              2               6

               T1    T2           T5    T3       T4         T6




                    P1 T1                        T6
                                   T5

                    P2       T2             T4         Miss Deadline !!
                                   T3

                         0                        12         Time

                             Actual Execution with NPM

                                                                          18
           Fixed-Order List Scheduling
with Shared Slack Reclamation for Dependent Tasks

             T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                     Ready Time
                      0         1             2              6

   Global Queue       T1   T2       T5        T3        T4       T6




                     0          2             1              6

   Global Queue       T1   T2   T3       T4        T5            T6




                                                                          19
List Scheduling with Shared Slack Reclamation
          Algorithm Implementation

    1    If (Head(Global-Q) is ready)
    2    {
    3    Tk = Dequeue (Global-Q);
    4    If ( STNTid > STNT~id )
    5        STNTid  STNT~id ;
    6    EETk = max{ RTck, STNTid, t } + ck ;
    7    STNTid = EETk;
    8    Sid = Smax * ck / ( EETk - t );
    9    If((Head(Global-Q) is ready) AND (P~id is idle))
    10      Signal(P~id);
    11    Execute(Tk, Sid);
    12   } else wait();


                                                            20
                          Algorithm : Example Step 1
                 T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                           Ready Time
                            0         2           1              6
           Global Queue
                            T1   T2   T3    T4            T5         T6

Time 0 Task 1(c1=3) dequeue
       id = 1
       STNT1 = 0, STNT2 = 0
       EET1 = max{0, 0, 0} + 3
                                                 P1 T1
       STNT1 = 3
       Cpu Speed 3/(3-0)  100 %
                                                 P2       T2
        Task 2(c2=2) dequeue
        id = 2                                        0    2 3            12   Time
        STNT1 = 3, STNT2 = 0
        EET2 = max{0, 0, 0} + 2
        STNT2 = 2
        Cpu Speed 2/(2-0)  100 %

                                                                                      21
                           Algorithm : Example Step 2
                  T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                            Ready Time
                                         2          1            6
            Global Queue
                                         T3   T4            T5       T6

Time 1 Head(Global-Q) is not ready
       so id = 1 is wait();


                                                   P1 T1

                                                   P2       T2

                                                        0        6        12   Time




                                                                                      22
                           Algorithm : Example Step 2
                  T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                            Ready Time
                                         2          1                 6
            Global Queue
                                         T3   T4            T5            T6

Time 2   Head(Global-Q) is ready
         Task 3(c1=4) dequeue
         id = 1
         STNT1 = 3, STNT2 = 2
                                                   P1 T1         T3
         Switch STNT for sharing Slack !!
         STNT1 = 2, STNT2 = 3
         EET3 = max{2, 2, 2} + 4                   P2       T2
         STNT1 = 6
         Cpu Speed 4/(6-2)  100 %                      0    23       6        12   Time




                                                                                           23
                          Algorithm : Example Step 3
                 T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                            Ready Time
                                                  1                 6
           Global Queue
                                            T4            T5            T6

Time 2 Task 4(c1=3) dequeue
       id = 2
       STNT1 = 6, STNT2 = 3
       EET4 = max{2, 3, 2} + 3
                                                 P1 T1         T3
       STNT2 = 6
       Cpu Speed 3/(6-2)  75 %
                                                 P2       T2   T4

                                                      0    23       6        12   Time




                                                                                         24
                          Algorithm : Example Step 4
                 T1=(3,1), T2=(2,2), T3=(4,4), T4=(3,3), T5=(6,6), T6=(6,6)

                           Ready Time
                                                 1             6
           Global Queue
                                                         T5        T6
Time 6 Task 5(c1=6) dequeue
       id = 1
       STNT1 = 6, STNT2 = 6
       EET5 = max{1, 6, 6} + 6
       STNT1 = 12
                                               P1 T1          T3        T5
       Cpu Speed 6/(12-6)  100 %

       Task 6(c1=6) dequeue                    P2        T2             T6
                                                              T4
       id = 2
       STNT1 = 12, STNT2 = 6                         0                       12    Time
       EET6 = max{6, 6, 6} + 6
       STNT2 = 12                                                   Meet Deadline !!
       Cpu Speed 6/(12-6)  100 %



                                                                                          25
                          Conclusion

- Good Performance Result.
   Up to 60% power saving in simulation.

- Problem for LSSR
   Need to reorder ready queue before start scheduling.

    Enhanced List Scheduling with Shared Slack Reclamation
     This technique does not need reordering queue




                                                          26

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:1
posted:7/8/2011
language:English
pages:26