Upload
vuongkien
View
221
Download
4
Embed Size (px)
Citation preview
9/26/2011
1
Multiprocessor Scheduling
5 2
1 6
8
4
new task
waiting queue
cpu 1 cpu 2 cpu 3
Global Scheduling
cpu 1 cpu 2 cpu 3
5
1
2
8
6
3
9
7
4
cpu 1 cpu 2 cpu 3
2
5
2
1
2 2
3
6
7
4
2 3
Partitioned Scheduling Partitioned Scheduling
with Task Splitting
Best Known Results
20
10
30
40
60
50
70
80
Multiprocessor Scheduling
Global Partitioned
Fixed
Priority
Dynamic
Priority
Task Splitting
Fixed
Priority
Dynamic
Priority
Fixed
Priority
Dynamic
Priority
38
%
50
Liu and Layland’s
Utilization Bound
50 50
65 66
[OPODIS’08]
[TPDS’05] [ECRTS’03] [RTSS’04]
[RTCSA’06]
From Uppsala RTAS 2010
69.3
9/26/2011
2
Fixed-Priority Multiprocessor Scheduling
Real-time Systems
N periodic tasks (of different rates/periods)
How to schedule the jobs to avoid deadline miss?
ri1 ri
2 ri3 ri
4
Ti Ti
Ji1 Ji
2 Ji3
Ti
Ci C
i
Ci
Utilization/workload:
9/26/2011
3
On Single-processors
Liu and Layland’s Utilization Bound [1973]
(the 19th most cited paper in computer science)
Scheduled by RMS (Rate Monotonic Scheduling)
number of tasks
Rate Monotonic Scheduling
Priority assignment: shorter period higher prio.
Run-time schedule: the highest priority first
How to check whether all deadlines are met?
high priority
mediate priority
low priority
… …
… …
… …
Run-time schedule
9/26/2011
4
Liu and Layland’s Utilization Bound
Schedulability Analysis
P
100%
Schedulable?
77.9% Ui 1 2 3
Ui = Ci / Ti
Liu and Layland’s bound:
Liu and Layland’s Utilization Bound
Schedulability Analysis
CPU
100%
Yes, schedulable! 77.9%
Liu and Layland’s bound:
1
2
3
9/26/2011
5
Quetion (since 1973)
Find a multiprocessor scheduling algorithm that can achieve Liu and Layland’s utilization bound
number of processors
?
Multiprocessor Scheduling
5 2
1 6
8
4
new task
waiting queue
cpu 1 cpu 2 cpu 3
Global Scheduling Would fixed-priority scheduling e.g. “RMS” work?
9/26/2011
6
Multiprocessor Scheduling
5 2
1 6
8
4
new task
waiting queue
cpu 1 cpu 2 cpu 3
Global Scheduling Would fixed-priority scheduling e.g. “RMS” work?
Unfortunately “RMS” suffers from the Dhall’s anomali
Utilization may be “0%”
Dhall’s anomali
1 CPU1
CPU2 2
3
1
2
ε 0 1+ ε 1
CPU3
9/26/2011
7
Dhall’s anomali
1 CPU1
CPU2 2
1
2
ε 0 1+ ε 1
3 3
Schedule the 3 tasks on 2 CPUs using “RMS
Deadline miss
Dhall’s anomali
… …
P1 P2 PM
#1 #2 #M … … #M+1
M*ε + 1/(1+ ε)
ε/1 ε/1 ε/1
1/(ε+1)
0 M
U
(M+1 tasks and M processors)
9/26/2011
8
Multiprocessor Scheduling
cpu 1 cpu 2 cpu 3
5
1
2
8
6
3
9
7
4
Partitioned Scheduling
Multiprocessor Scheduling
cpu 1 cpu 2 cpu 3
5
1
2
8
6
3
9
7
4
Partitioned Scheduling
Resource utilization may be limited to 50%
9/26/2011
9
Partitioned Scheduling
Partitioning
P1
1
P2 P3
1 3 1 2
4 5 6
7 8 9
Partitioned Scheduling
Partitioning
P1 P2 P3
3
1
2
4
5
6
7
8
9
9/26/2011
10
Partitioned Scheduling
Scheduling
reduced to single-processor scheduling on each processor
P1 P2 P3
3
1
2
4
5
6
7
8
9
… …
… …
… …
P
100%
Yes, schedulable! 77.9%
1
2
3
Partitioned Scheduling
The Partitioning Problem is similar to Bin-packing Problem (NP-hard)
Limited Resource Usage, 50% necessary condition to guarantee schedulability
… …
P1 P2 PM
#1 #2 #M … … #M+1 50%+ ε
9/26/2011
11
Partitioned Scheduling
The Partitioning Problem is similar to Bin-packing Problem (NP-hard)
Limited Resource Usage necessary condition to guarantee schedulability
… …
P1 P2 PM
#1 #2 #M
… … #M+1 50%+ ε
Partitioned Scheduling
The Partitioning Problem is similar to Bin-packing Problem (NP-hard)
Limited Resource Usage necessary condition to guarantee schedulability
… …
P1 P2 PM
#1 #2 #M
… … #M+1,1 50%+ ε
#M+1,2
9/26/2011
12
Partitioned Scheduling
The Partitioning Problem is similar to Bin-packing Problem (NP-hard)
Limited Resource Usage necessary condition to guarantee schedulability
… …
P1 P2 PM
#1 #2 #M
… …
#M+1,1
50%+ ε
#M+1,2
Multiprocessor Scheduling
cpu 1 cpu 2 cpu 3
2
5
2
1
2 2
3
6
7
4
2 3
Partitioned Scheduling with Task Splitting
9/26/2011
13
Partitioned Scheduling
Partitioning
P1
1
P2 P3
1 3 1 2
4 5 6
7 8 9
Bin-Packing with Item Splitting
Resource can be “fully” (better) utilized
Bin1 Bin2 Bin3
12 3
11
2 4 5
7 82
6 81
9/26/2011
14
Depth-First Partitioning Algorithms [Kato et al. IPDPS’08] [Kato et al. RTAS’09] [Lakshmanan et al. ECRTS’09]
Sort the tasks e.g. in increasing priority order
Select a processor, and assign as many tasks as possible
3
4
2
5
1
6
8
7
highest priority
lowest priority P1
Lakshmanan’s Algorithm [ECRTS’09]
Sort all tasks in decreasing order of utilization
3
4
2
5
1
6
8
7
lowest util.
highest util.
9/26/2011
15
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
3
4
2
5
1
6
8
7
lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
5
1
6
7
lowest util.
highest util.
9/26/2011
16
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
5
1
6
7
lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
5
1
62
7
61
lowest util.
highest util.
9/26/2011
17
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
5
1
62
7
61
P2
lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
5
1
7
61
P2
62
lowest util.
highest util.
9/26/2011
18
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
4
2
1
7
61
P2
5 62
lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
3
2
1
7
61
P2
5 62
4
lowest util.
highest util.
9/26/2011
19
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
2
1
7
61
P2
5 62
4
3
lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
1
7
61
P2
5 62
4
3 21
22
lowest util.
highest util.
9/26/2011
20
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
7
61
P2
5 62
4
3 21
P3
22
1 lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
7
61
P2
5 62
4
3 21
P3
1 22
lowest util.
highest util.
9/26/2011
21
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
7
61
P2
5 62
4
3 21
P3
1 22
key feature: “depth-first” partitioning
with decreasing utilization order lowest util.
highest util.
Lakshmanan’s Algorithm [ECRTS’09]
Pick up one processor, and assign as many tasks as possible
P1
8
7
61
P2
5 62
4
3 21
P3
1 22
Utilization Bound:
65% lowest util.
highest util.
9/26/2011
22
Breadth-First Partitioning Algorithms [RTAS 2010]
Sort all tasks in increasing priority order
7
6
5
4
3
2
1 highest priority
lowest priority
Select the processor on which the assigned utilization is the lowest
7
6
5
4
3
2
1
P1 P2 P3
highest priority
lowest priority
Breadth-First Partitioning Algorithms
9/26/2011
23
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
6
5
4
3
2
1
P1 P2 P3
7
highest priority
lowest priority
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
5
4
3
2
1
P1 P2 P3
7 6
highest priority
lowest priority
9/26/2011
24
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
4
3
2
1
P1 P2 P3
7 6 5
highest priority
lowest priority
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
3
2
1
P1 P2 P3
7 6 5 4
highest priority
lowest priority
9/26/2011
25
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
2
1
P1 P2 P3
7 6 5 4
3
highest priority
lowest priority
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
1
P1 P2 P3
7 6 5 4
3 21
22
highest priority
lowest priority
9/26/2011
26
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
1
P1 P2 P3
7 6 5 4
3 21 22
highest priority
lowest priority
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
P1 P2 P3
7 6 5 4
3 21
12
11
22
highest priority
lowest priority
9/26/2011
27
Breadth-First Partitioning Algorithms
Select the processor on which the assigned utilization is the lowest
P1 P2 P3
7 6 5 4
3 21 12 11
22
Comparison
P1
8
7
61
P2
5 62
4
31
P3
1
2
32
P1 P2
3
P3
11
8
4
2
7 6
5
12
Why is the breadth algorithm better?
& increasing priority order
breadth-first depth-first
& decreasing utilization order
9/26/2011
28
Fact for “Light” Tasks whose utilization less than 0.41
For a task set in which each task satisfies
we have
Solution for Heavy Tasks whose utilization larger than 0.41
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8
7
6
9
3
9/26/2011
29
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8
7
6
9
3
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8
7
6
9
3
9/26/2011
30
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8
7
6
9
3
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8 7 6
9
3
9/26/2011
31
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5
4
2
1
8 7 6
9
3
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5 4
2
1
8 7 6
9
3
9/26/2011
32
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5 4
2
1
8 7 6
9
3
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5 4 2
1
8 7 6
9
3
9/26/2011
33
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
highest priority
lowest priority
5 4 2
12
8 7 6
9
3 11
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
5 4 2
8 7 6
9
3 11 12
9/26/2011
34
Solution for Heavy Tasks
Pre-assigning the heavy tasks (that may have low priorities)
P1 P2 P3
5 4 2
8 7 6
9
3 11 12
avoid to split heavy tasks (that may have low priorities)
FACT
By introducing the pre-assignment mechanism, we have
Liu and Layland’s utilization bound for all task sets!
9/26/2011
35
Overhead
In both previous algorithms and ours
The number of task splitting is at most M-1
task splitting -> extra “migration/preemption”
Our algorithm on average has less task splitting
P1 P2 P3 P1 P2 P3
Ours: width-first depth-first
Implementation
Easy!
One timer for each split task
Implemented as “task migration”
i1
Ci1
P1
P2
task i
higher prio
tasks
i2
until finished
as being resumed
as being preempted
lower prio
tasks
9/26/2011
36
Further Improvement
P1
100%
Schedulable? P2 P3
3
2
1
6
5
4
9
8
7
Uisng Liu and Layland’s Utilization Bound
P1 P2 P3
Yes, schedulable by our algorithm 100%
9/26/2011
37
Utilization Bound is Pessimistic
The Liu and Layland utilization bound is sufficient but not necessary
many task sets are actually schedulable even if the total utilization is larger than the bound
P
1 0.69
(1, 4)
(2, 12)
(1, 4)
(2, 8)
Exact Analysis
Exact Analysis: Response Time Analysis [Lehoczky_89]
pseudo-polynomial
(1, 4)
(2, 12)
(1, 4)
(2, 8)
Rk
task k is schedulable iff Rk <= Tk
9/26/2011
38
Utilization Bound v.s. Exact Analysis
On single processors
P
100%
Utilization bound Test for RMS
P
Exact Analysis for RMS
[Lehoczky_89]
88% 100%
On Multiprocessors
Can we do something similar on multiprocessors?
P1 P2 P3
Utilization bound Test the algorithm introduced above ?
P1 P2 P3
100% 100%
9/26/2011
39
An Improved Algorithm
Based on the similar idea
RMS priority assignment
worst-fit partitioning
increasing priority order
Employ Response Time Analysis to determine the maximal workload on each processor
more flexible behavior (more difficult to prove …)
Same utilization bound
Liu and Layland’s utilization bound
Much better performance
Pseudo-polynomial
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
9/26/2011
40
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
On Single-processors
Liu and Layland’s Utilization bound
80
70
60
50
40
30
20
10
0
% Liu and Layland’s Utilization Bound
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
On Single-processors
Liu and Layland’s Utilization bound
On Multiprocessors
80
70
60
50
40
30
20
10
0
% Liu and Layland’s Utilization Bound
Multiprocessor Scheduling
9/26/2011
41
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
On Single-processors
Liu and Layland’s Utilization bound
On Multiprocessors
Global Scheduling
Dhall’s Effect
80
70
60
50
40
30
20
10
0
% Liu and Layland’s Utilization Bound
38
[OPODIS’08]
Global
Multiprocessor Scheduling
1 P1
P2 2
P3 3
4
1
2
3 4 4
deadline miss
ε 0 1+ ε 1
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
On Single-processors
Liu and Layland’s Utilization bound
On Multiprocessors
Global Scheduling
Dhall’s Effect
Partitioned Scheduling
Bin-packing
80
70
60
50
40
30
20
10
0
% Liu and Layland’s Utilization Bound
38
[OPODIS’08]
Global
Multiprocessor Scheduling
50
[ECRTS’03]
Partitioned
9/26/2011
42
Summary
Real-time Systems
infinite, multi-task, multi-rate … …
On Single-processors
Liu and Layland’s Utilization bound
On Multiprocessors
Global Scheduling
Dhall’s Effect
Partitioned Scheduling
Bin-packing
Our Recent Work
Partitioned with Task Splitting
split tasks with high priorities
Liu and Layland’s utilization bound
80
70
60
50
40
30
20
10
0
% Liu and Layland’s Utilization Bound
38
[OPODIS’08]
Global
Multiprocessor Scheduling
50
[ECRTS’03]
Partitioned
[Our Work]
Splitting
References
[Liu1973] C.L. Liu and James Layland, Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment
[Andersson03ECRTS] Bjorn Andersson, Jan Jonsson: The Utilization Bounds of partitioned and Pfair Static-Priority Scheduling on multiprocessors are 50%. ECRTS 2003
[Andersson08OPODIS] Bjorn Andersson: Global Static-Priority Preemptive Multiprocessor Scheduling with Utilization Bound 38%. OPODIS 2008
[Andersson06RTCSA] Bjorn Andersson, Eduardo Tovar: Multiprocessor Scheduling with Few preemption. RTCSA 2006
[Andersson01RTSS] Bjorn Andersson, Sanjoy K. Baruah, Jan Jonsson: Static-Priority Scheduling on multiprocessors. RTSS 2001
[Baker05TPDS] Theodore P. Baker: An Analysis of EDF Schedulability on a Multiprocessor. IEEE Trans. Parallel Distrib. Syst. 16(8): 760-768 (2005)
[Lakshmanan09ECRTS] Karthik Lakshmanan, Ragunathan Rajkumar, John Lehoczky Partitioned Fixed-Priority Preemptive Scheduling for Multi-core Processors. ECRTS 20006
[Lopez04RTSS] J. M. Lopez, J. L. Diaz, and D. F. Garcia, ”Utilization Bounds for EDF Scheduling on Real-Time Multiprocessor Systems”, RTSS 2004.
[Oh98] D. Oh and T. P. Baker. Utilization bounds for n-processor Rate Monotone scheduling with static processor assignment. In Real-Time Systems, 1998.
[Kato08IPDPS] Shinpei Kato, Nobuyuki Yamasaki: Portioned static-priority scheduling on multiprocessors. IPDPS 2008
[Kato09RTAS] Shinpei Kato, Nobuyuki Yamasaki: Semi-partitioned Fixed-Priority Scheduling on Multiprocessors. RTAS 2009.
[Guan et al10RTAS] Fixed-Priority Multiprocessor Scheduling with Liu & Layland's Utilization Bound. Nan Guan, Martin Stigge, Wang Yi and Ge Yu. In the proc. of RTAS10, the 16th IEEE Real-Time and Embedded Technology and Applications Symposium Stockholm, Sweden, April 12 - 15, 2010.