Download presentation
Presentation is loading. Please wait.
Published byGwendolyn Bolton Modified over 10 years ago
1
DP-F AIR : A Simple Model for Understanding Optimal Multiprocessor Scheduling Greg Levin † Shelby Funk ‡ Caitlin Sadowski † Ian Pye † Scott Brandt † † University of California ‡ University of Georgia Santa Cruz Athens
2
Backstory NQ-Fair by Shelby Funk (Rejected from RTSS) S N S by Greg, Caitlin, Ian, and Scott (Rejected from RTSS) DP-Fair
3
Multiprocessors Most high-end computers today have multiple processors In a busy computational environment, multiple processes compete for processor time More processors means more scheduling complexity
4
4 Real-Time Multiprocessor Scheduling Real-time tasks have workload deadlines Hard real-time = “Meet all deadlines!” Problem: Scheduling periodic, hard real- time tasks on multiprocessor systems. This is difficult.
5
5 Real-Time Multiprocessor Scheduling easy!! Real-time tasks have workload deadlines Hard real-time = “Meet all deadlines!” Problem: Scheduling periodic, hard real- time tasks on multiprocessor systems. This is difficult.
6
Taxonomy of Multiprocessor Scheduling Algorithms Uniprocessor Algorithms LLFEDF Partitioned Algorithms Globalized Uniprocessor Algorithms Global EDF Dedicated Global Algorithms Partitioned EDF Optimal Algorithms EKG LLREF pfair
7
7 Partitioned Schedulers ≠ Optimal Example: 2 processors; 3 tasks, each with 2 units of work required every 3 time units
8
8 Global Schedulers Succeed Example: 2 processors; 3 tasks, each with 2 units of work required every 3 time units Task 3 migrates between processors
9
9 Problem Model n tasks running on m processors A periodic task T = (p, e) requires a workload e be completed within each period of length p T's utilization u = e / p is the fraction of each period that the task must execute job release time = 0 p 2p2p 3p3p job release period p workload e
10
time work completed job release deadline Fluid Rate Curve period p workload e fluid rate curve utilization u = slope = e/p actual work curve slope = 0 or 1 10
11
job release deadline Feasible Work Region period p workload e zero laxity work complete work completed time 11 CPU rate = 1
12
12 Assumptions Processor Identity: All processors are equivalent Task Independence: Tasks are independent Task Unity: Tasks run on one processor at a time Task Migration: Tasks may run on different processors at different times No overhead: free context switches and migrations In practice: built into WCET estimates
13
13 The Big Goal (Version 1) Design an optimal scheduling algorithm for periodic task sets on multiprocessors A task set is feasible if there exists a schedule that meets all deadlines A scheduling algorithm is optimal if it can always schedule any feasible task set
14
14 Necessary and Sufficient Conditions Any set of tasks needing at most 1) 1 processor for each task ( for all i, u i ≤ 1 ), and 2) m processors for all tasks ( u i ≤ m) is feasible Proof: Small scheduling intervals can approximate a task's fluid rate curve Status: Solved pfair (1996) was the first optimal algorithm
15
15 The Big Goal (Version 2) Design an optimal scheduling algorithm with fewer context switches and migrations ( Finding a feasible schedule with fewest migrations is NP-Complete )
16
16 The Big Goal (Version 2) Design an optimal scheduling algorithm with fewer context switches and migrations Status: Solved BUT, the solutions are complex and confusing Our Contributions: A simple, unifying theory for optimal global multiprocessor scheduling and a simple optimal algorithm
17
17 Greedy Algorithms Fail on Multiprocessors A Greedy Scheduling Algorithm will regularly select the m “best” jobs and run those Earliest Deadline First (EDF) Least Laxity First (LLF) EDF and LLF are optimal on a single processor ; neither is optimal on a multiprocessor Greedy approaches generally fail on multiprocessors
18
18 Example (n = 3 tasks, m = 2 processors) : Why Greedy Algorithms Fail On Multiprocessors
19
19 Why Greedy Algorithms Fail On Multiprocessors At time t = 0, Tasks 1 and 2 are the obvious greedy choice
20
20 Why Greedy Algorithms Fail On Multiprocessors Even at t = 8, Tasks 1 and 2 are the only “reasonable” greedy choice
21
21 Why Greedy Algorithms Fail On Multiprocessors Yet if Task 3 isn’t started by t = 8, the resultant idle time eventually causes a deadline miss
22
22 Why Greedy Algorithms Fail On Multiprocessors How can we “see” this critical event at t = 8?
23
23 Proportioned Algorithms Succeed On Multiprocessors Subdivide Task 3 with a period of 10
24
24 Proportioned Algorithms Succeed On Multiprocessors Now Task 3 has a zero laxity event at time t = 8
25
25 Proportional Fairness Insight: Scheduling is easier when all jobs have the same deadline Application: Apply all deadlines to all jobs Assign workloads proportional to utilization Work complete matches fluid rate curve at every system deadline
26
26 Proportional Fairness Is the Key All known optimal algorithms enforce proportional fairness at all deadlines: pfair (1996) - Baruah, Cohen, Plaxton, and Varvel ( proportional fairness at all times ) BF (2003) - Zhu, Mossé, and Melhem LLREF (2006) - Cho, Ravindran, Jensen EKG (2006) - Andersson, Tovar Why do they all use proportional fairness?
27
27 Scheduling Multiple Tasks is Complicated time work completed
28
28 Scheduling Multiple Tasks with Same Deadline is Easy work completed time
29
Actual Feasible Regions 29 work completed time job deadlines
30
Restricted Feasible Regions Under Deadline Partitioning 30 work completed time all system deadlines
31
31 The DP-Fair Scheduling Policy Partition time into slices based on all system deadlines Allocate each job a per-slice workload equal to its utilization times the length of the slice Schedule jobs within each slice in any way that obeys the following three rules: 1. Always run a job with zero local laxity 2. Never run a job with no workload remaining in the slice 3. Do not voluntarily allow more idle processor time than ( m - u i ) x ( length of slice )
32
time DP-Fair Work Allocation time slice Allocated workload slope = utilization 32 work completed
33
DP-Fair Scheduling Rule #1 zero local laxity line When job hits zero local laxity, run to completion 33 time work completed time slice
34
DP-Fair Scheduling Rule #2 time slice local work complete line When job finishes local workload, stop running 34 time work completed
35
DP-Fair Scheduling Rule #3 time slice Don’t voluntarily allow idle time in excess of this limit slope = m - u i slope = m Allowable idle time 35 time idle time
36
36 DF-Fair Guarantees Optimality We say that a scheduling algorithm is DP-Fair if it follows these three rules Theorem: Any DP-Fair scheduling algorithm for periodic tasks is optimal
37
37 Proof of Theorem
38
38 DP-Fair Implications ( Partition time into slices ) + ( Assign proportional workloads ) Optimal scheduling is almost trivial Minimally restrictive rules allow great latitude for algorithm design and adaptability What is the simplest possible algorithm?
39
All time slices are equivalent (up to linear scaling), so normalize time slice length to 1 Jobs have workload = utilization Schedule by “stacking and slicing” Line up job utilization blocks Slice at integer boundaries 39 The DP-Wrap Algorithm
40
40 The DP-Wrap Algorithm Example: 3 processors, 7 tasks
41
41 The DP-Wrap Algorithm Example: 3 processors, 7 tasks
42
42 The DP-Wrap Algorithm Example: 3 processors, 7 tasks
43
43 The DP-Wrap Algorithm
44
44 DP-Wrap Performance n−1 context switches and m−1 migrations per time slice This is about 1/3 as many as LLREF, similar to BF, and somewhat more than EKG DP-Wrap has very low (O(n)) computational complexity
45
45 Extending DP-Fair: Sporadic Arrivals, Arbitrary Deadlines Sporadic arrivals: jobs from a task arrive at least p time units apart Arbitrary deadlines: A job from T = (p, e, D) has a deadline D time units after arrival; D may be smaller or larger than p DP-Fair and DP-Wrap are easily modified to handle these cases
46
46 DP-Fair Easily Extended Extending optimal algorithms to sporadic tasks and arbitrary deadlines has previously been difficult pfair : 10 years LLREF : 3 years DP-Fair & DP-Wrap: 3 weeks
47
Ongoing Work Extend to uniform multiprocessors (CPUs running at different speeds) Extend to random, unrelated job model Heuristic improvements to DP-Wrap Work-conserving scheduling Slice merging
48
48 Summary DP-Fair : Simple rules to make optimal real-time multiprocessor scheduling easy!! DP-Wrap : Simplest known optimal multiprocessor scheduling algorithm Extensible : DP-Fair and DP-Wrap easily handle sporadic tasks with arbitrary deadlines We plan to extend DP-Fair and DP-Wrap to more general problem domains
49
49 Thanks for Listening Questions?
50
50 === EXTRA SLIDES === 1. Sporadic Tasks, Arbitrary Deadlines
51
51 Sporadic Arrivals, Arbitrary Deadlines We extend our task definition to T i = (p i, e i, D i ), where each job of T i has a deadline D i time units after its arrival; D i may be smaller or larger than p i. These are referred to as arbitrary deadlines. Sporadic arrivals means that p i is now the minimum inter-arrival time for T i 's jobs, so that a new job will arrive at least p i time units after the previous arrival. Scheduling is on-line, i.e. we don't know ahead of time when new jobs will arrive
52
52 Task Density Our expression for utilization must be updated to the density of a task: i = e i / min{ p i, D i } and are still sufficient conditions for the feasibility of a task set, but they are no longer necessary. Example: T 1 = (2, 1, 1), T 2 = (2, 1, 2) on m = 1 is feasible, although = 1.5.
53
53 Optimality Our updated DP-Fair rules for sporadic tasks with arbitrary deadlines will allow an algorithm to schedule any task set with and ; in fact, we require that these conditions hold Since feasible task sets exist where these conditions do not hold, DP-Fair algorithms are not optimal in this problem domain This is an acceptable limitation, since it has recently been proven that no optimal scheduler can exist for sporadic tasks
54
54 Updated DP-Fair Scheduling The rules for scheduling within time slices is nearly the same with sporadic tasks and arbitrary deadlines The third rule is now: "Do not voluntarily allow more than units of idle time to occur during the time slice before time t" The F j (t) term represents unused capacity between tasks' deadlines and next arrivals
55
55 Updated DP-Fair Allocation The rules for allocating workloads in time slices become more complicated than simple proportionality A task is active between its arrival and its deadline. When a task becomes active, it is allocated a workload proportional to its density and the length of its active segment in the slice If a job arrives during a slice that will have a deadline within the slice, the remainder of the slice is partitioned into two new subslices, with a subslice boundary at the deadline, and remaining work for all tasks allocated proportionally to subslice lengths
56
Handling a Sporadic Arrival time slice Workload allocated upon arrival Sporadic arrival in the middle of a slice 56 time work completed
57
Managing Idle Time time slice Available idle time grows by utilization of unarrived sporadic job… slope = m - u i slope = m Original idle time pool …until that job finally arrives Additional idle time from late arrival 57 time idle time
58
58 Theorem 3 Any DP-Fair scheduling algorithm for sporadic tasks with arbitrary deadlines will successfully schedule any task set where and
59
59 Modifying DP-Wrap The DP-Wrap algorithm is easily modified to accommodate the DP-Fair scheduling rules for sporadic tasks with arbitrary deadlines If a job arrives during a time slice, wrap it onto the end of the stack of blocks If the arriving job has a deadline within the current slice, partition the remainder of the slice into two subslices, as per our previous rule, and apply the usual scheduling rules to both of these subslices
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.