Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science Department University of Pittsburgh Multiple-Resource Periodic Scheduling Problem: how much fairness is necessary? Dakai Zhu, Daniel Mossé.

Similar presentations


Presentation on theme: "Computer Science Department University of Pittsburgh Multiple-Resource Periodic Scheduling Problem: how much fairness is necessary? Dakai Zhu, Daniel Mossé."— Presentation transcript:

1 Computer Science Department University of Pittsburgh Multiple-Resource Periodic Scheduling Problem: how much fairness is necessary? Dakai Zhu, Daniel Mossé and Rami Melhem The work is supported by DARPA through the PARTS project.

2 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 2 Preface  Power-aware computing for parallel systems  Frame based task sets  Shared Memory Systems Traditional AND-model applications: TPDS’03 AND/OR-model applications: to appear in TPDS  Distributed Systems: IPDPS’03  Periodic task sets  Global scheduler: P-fair [Baruah’96]

3 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 3 Problem  Scheduling  n periodic tasks, each task T i with (c i, p i ) c i, p i are integers (i.e.,multiples of system time unit) Weight: w i = c i / p i ; System U =  w i  m resources (m  U)  Constraints: at any time One resource  one task (resources are not shareable) One task occupies one resource (tasks are not parallel)  Optimal  Full utilization (U = m);  Scheduling overhead;  Number of Context switches;

4 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 4 Previous Work  EDF/RM: dynamic/static priority  Optimal for single resource  The famous task set [Dhall’78] (n –1) tasks with (2* , 1); 1 task with (1, 1+  ) U = (2*  (n-1) + 1/(1+  ) )/n  0 with big n  Harmonic tasks: periods are multiples of each other  [Mancini’94] and [Khemka’97]

5 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 5 Previous Work (cont.)  PF: proportional fairness [Baruah’96]  Proportional progress for tasks at ANY time At time t: either  w i * t  or  w i * t  Absolute allocation error: less than one time unit  Optimal: full utilization, U = m;  Variations of P-fair algorithms  PD [Baruah’95]  PD 2 [Anderson’01]  ER-fair [Anderson’00] Scheduling decision at EVERY time unit !

6 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 6 An Example  T 1 =(1, 3), T 2 =(2, 5), T 3 =(2, 5), T 4 =(2, 3), T 5 =(1, 5)  m=U=  w i =2, LCM = 15;  PF schedule [Baruah’96]  15 scheduling points  27 context switches Deadline miss only happens at period boundaries ! 212312312412124 434454443543435 0123456781091112131415 R2R2 R1R1 0123456781091112131415

7 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 7 B-Fair: A new approach  Idea  Schedule ONLY at period boundaries Allocate resources to tasks for the time units within two consecutive boundaries  Maintain fairness at boundary time b k (B-Fair) T i get either  w i * b k  or  w i * b k   Two-step allocation Mandatory units to keep fairness Optional units for future urgent tasks

8 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 8 The Example  T 1 =(1, 3), T 2 =(2, 5), T 3 =(2, 5), T 4 =(2, 3), T 5 =(1, 5) 0123456781091112131415 T 1 T 2 T 3 T 4 T 5 At boundary time 0: allocate [0  3) Demand 1 6/5 6/5 2 3/5 Mandatory 1 1 1 2 0 pending 0 1/5 1 /5 0 3/5 Tasks T 2, T 3,T 5 are eligible for the optional unit ? R2R2 R1R1

9 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 9 BF Algorithm  Define a set of boundaries: {b 0, …, b L }  b k < b k+1 ; b 0 = 0, b L = LCM;   k,  T i, b k is a multiple of p i ;  At b k, we allocate [b k, b k+1 )  Mandatory units  Optional units m i k = max{ 0,  RW i k + w i *(b k+1 – b k )  } RW i k = Remaining work for T i before b k RW i k = w i * b k – allocated units for T i  m*(b k+1 – b k ) >  m i k

10 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 10 BF Algorithm (cont.)  Eligible tasks Pending work:PW i k =RW i k + w i *(b k+1 – b k ) - m i k > 0 Not fully allocated: m i k < b k+1 – b k  Dynamic priority: urgency of future  Character string  Time Factor (TF)  : idea from P-fair [Baruah’96]  k (T i ) = sign[b k+1 *w i –  b k *w i  – (b k+1 - b k )]  (T i, k) =  k+1 (T i ), …,  k+s (T i ) Minimum s such that  k+s (T i )  ‘+’  : when  k+s (T i ) = ‘–’

11 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 11 BF Algorithm (cont.)  For eligible tasks T i and T j  Compare  (T i, k) and  (T i, k) Character by character: ‘+’ > ‘0’ > ‘–’ Bigger string has higher priority  If tie and last character is ‘0’: arbitrary  If tie and last character is ‘–’ Compare time factor (TF) smaller time factor has higher priority If tie again: arbitrary, e.g., smaller index  High priority tasks get one optional unit each

12 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 12 The Example (cont.)  T 1 =(1, 3), T 2 =(2, 5), T 3 =(2, 5), T 4 =(2, 3), T 5 =(1, 5) 0123456781091112131415 T 1 T 2 T 3 T 4 T 5 pending 0 1/5 1 /5 0 3/5 string * - - * -* 0 0 * 0 TF Mandatory 1 1 1 2 0 0 1 0 0 0 Optional 122 344 31231241212 44544435434 3 5 Compared BF vs. PF: Scheduling Points: 7 vs. 15 Context Switches: 24 vs. 27 R2R2 R1R1

13 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 13 Complexity of BF  For each scheduling point: O(n*p max )  Mandatory units allocation: O(n)  Optional units: O(n*p max ) Priority compare: O(p max ) Linear selection from ‘n’ tasks: O(n) [Blum’73]  Improved BF: O(n);  Improve priority comparison: O(1) If  k (T i ) =  k (T j ) = ‘+’, consider two counter-task with weight of 1-w i and 1-w j, respectively.  k (CT i ) =  k (CT j ) = ‘-’: compare their time factors (TF) Bigger TF gets higher priority  Efficient P-fair: PD has O(min{n, m log n} ) [Baruah’95]

14 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 14 Number of Scheduling Points  Up to 100 tasks  Min period: 10  Max period  20  100  LCM  2 32

15 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 15 Cycles per Scheduling Point  Up to 100 tasks  Min period: 10  Max period: 100  c i is randomly chosen from 1 to p i ; i.e., m  n/2  Conservative implementation

16 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 16 Total Time to Generate Schedules  Up to 100 tasks  Min period: 10  Max period: 100  c i is randomly chosen from 1 to p i ; i.e., m  n/2

17 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 17 Conclusion  Notion of boundary-fairness  BF is optimal: full system utilization  Fewer scheduling points than P-fair algorithms  Complexity per scheduling point is O(n)  Comparable to PD: O (min {n, m log n} )  Less total time to generate schedules  Compared with PD: less than 100 tasks

18 Computer Science Department University of Pittsburgh Multiple-Resource Periodic Scheduling Problem: how much fairness is necessary? Dakai Zhu, Daniel Mossé and Rami Melhem Questions ?

19 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 19 Analysis of B-Fair  Ahead, behind, punctual task sets  RW i k 0, =0; respectively  Pre-ahead, pre-behind task set  PW i k 0; respectively

20 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 20 Analysis of B-Fair (cont.)  No tasks miss the deadline if m   (w i )  When allocating [b k, b k+1 ): m =  (w i )  No over requirement  m i k  m*(b k+1 – b k )  Enough eligible tasks At least m*(b k+1 – b k ) –  m i k  Otherwise, non-empty ahead set and behind set for each previous boundary, which contradicts at b 0

21 Computer Science Department University of Pittsburgh www.cs.pitt.edu/PARTS 21 Performance Evaluation (cont.)  Generally, prime number points are not scheduling point for B-Fair  Prime number theory: big number x  x / ln(x) prime numbers smaller than x  LCM: > 1/lnLCM  10 3  >14.5%  10 6  >7.24%  10 9  > 5%


Download ppt "Computer Science Department University of Pittsburgh Multiple-Resource Periodic Scheduling Problem: how much fairness is necessary? Dakai Zhu, Daniel Mossé."

Similar presentations


Ads by Google