Multiprocessor Scheduling I: Partitioned Scheduling Prof. Dr. Jian-Jia Chen LS 12, TU Dortmund 22/23, June, 2015 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 1 / 47
Outline Introduction to Multiprocessor Scheduling Partitioned Scheduling for Implicit-Deadline EDF Scheduling Partitioned Scheduling for Implicit-Deadline RM Scheduling Partitioned Scheduling for Constrained-Deadline DM Scheduling Partitioned Scheduling for Arbitrary-Deadline EDF Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 2 / 47
Multiprocessor Models Identical (Homogeneous): All the processors have the same characteristics, i.e., the execution time of a job is independent on the processor it is executed. Uniform: Each processor has its own speed, i.e., the execution time of a job on a processor is proportional to the speed of the processor. A faster processor always executes a job faster than slow processors do. For example, multiprocessors with the same instruction set but with different supply voltages/frequencies. Unrelated (Heterogeneous): Each job has its own execution time on a specified processor A job might be executed faster on a processor, but other jobs might be slower on that processor. For example, multiprocessors with different instruction sets. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 3 / 47
Scheduling Models Partitioned Scheduling: Each task is assigned on a dedicated processor. Schedulability is done individually on each processor. It requires no additional on-line overhead. Global Scheduling: A job may execute on any processor. The system maintains a global ready queue. Execute the M highest-priority jobs in the ready queue, where M is the number of processors. It requires high on-line overhead. Semi-Partitioned Scheduling: Adopt task partitioning first and reserve time slots (bandwidths) for tasks that allow migration. It requires some on-line overhead. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 4 / 47
Course Material Ronald L. Graham: Bounds for certain multiprocessing anomalies. in Bell System Technical Journal (1966). Ronald L. Graham: Bounds on Multiprocessing Timing Anomalies. SIAM Journal of Applied Mathematics 17(2): 416-429 (1969) Dorit S. Hochbaum, David B. Shmoys: Using dual approximation algorithms for scheduling problems theoretical and practical results. J. ACM 34(1): 144-162 (1987) (in textbook Approximation Algorithms by Vijay Vazirani, Chapter 10, not covered) Sanjoy K. Baruah, Nathan Fisher: The Partitioned Multiprocessor Scheduling of Sporadic Task Systems. RTSS 2005: 321-329 Jian-Jia Chen: Partitioned Multiprocessor Fixed-Priority Scheduling of Sporadic Real-Time Tasks. CoRR abs/1505.04693 (2015) Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 5 / 47
Terminologies Used in Scheduling Theory Graham s Scheduling Algorithm Classification Classification: a b c a: machine environment (e.g., uniprocessor, multiprocessor, distributed,...) b: task and resource characteristics (e.g., preemptive, independent, synchronous,...) c: performance metric and objectives (e.g., L max, sum of finish times,...) Makespan problem: M C max The course material mainly comes from the traditional makespan scheduling in the context of minimizing the maximum utilization. (The paper by Baruah and Fisher in RTSS 2005 is an exception.) Imagine that the goal is to minimize the maximum utilization after task partitioning. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 6 / 47
Bin Packing Problem Given a bin size b, and a set of items with individual sizes, the objective is to assign each item to a bin without violating the bin size constraint such that the number of allocated bins is minimized. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 7 / 47
Outline Introduction to Multiprocessor Scheduling Partitioned Scheduling for Implicit-Deadline EDF Scheduling Partitioned Scheduling for Implicit-Deadline RM Scheduling Partitioned Scheduling for Constrained-Deadline DM Scheduling Partitioned Scheduling for Arbitrary-Deadline EDF Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 8 / 47
Problem Definition Partitioned Scheduling Given a set T of tasks with implicit deadlines, i.e., τ i T, = D i, the objective is to decide a feasible task assignment onto M processors such that all the tasks meet their timing constraints, where C im is the execution time of task τ i on processor m. For identical multiprocessors: C i = C i1 = C i2 = = C im. For uniform multiprocessors: each processor m has a speed s m, in which C im s m is a constant. For unrelated multiprocessors: C im is an independent variable. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 9 / 47
Hardness and Approximation of Partitioned Scheduling N P-complete Deciding whether there exists a feasible task assignment is N P-complete in the strong sense. Proof Reduced from the makespan or the bin packing problem. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 10 / 47
Hardness and Approximation of Partitioned Scheduling N P-complete Deciding whether there exists a feasible task assignment is N P-complete in the strong sense. Proof Reduced from the makespan or the bin packing problem. Approximations are possible, but what do we approximate when only binary decisions (Yes or No) have to be made? Deadline relaxation: requires modifications of task specification Period relaxation: requires modifications of task specification Resource augmentation by speeding up: requires a faster platform Resource augmentation by allocating more processors: requires a better platform Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 10 / 47
Approximation Algorithms An algorithm A is called an η-approximation algorithm (for a minimization problem) if it guarantees to derive a feasible solution for any input instance I with at most η times of the objective function of an optimal solution. That is, A(I ) ηopt (I ), where OPT (I ) is the objective function of an optimal solution. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 11 / 47
Largest-Utilization-First (LUF) - for EDF Scheduling Input: T, M; 1: re-index (sort) tasks such that C i C j T j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: find m with the minimum utilization, i.e., U m = min m M U m ; 5: if U m + C i > 1 then 6: return The task assignment fails ; 7: else 8: assign task τ i onto processor m, where U m U m + C i, {τ i }; 9: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 12 / 47
Largest-Utilization-First (LUF) - for EDF Scheduling Input: T, M; 1: re-index (sort) tasks such that C i C j T j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: find m with the minimum utilization, i.e., U m = min m M U m ; 5: if U m + C i > 1 then 6: return The task assignment fails ; 7: else 8: assign task τ i onto processor m, where U m U m + C i, {τ i }; 9: return feasible task assignment T 1, T 2,..., T M ; Properties The time complexity is O((N + M) log(n + M)) If a solution is derived, the task assignment is feasible by using EDF. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 12 / 47
Algorithm LUF τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (0, 0, 0) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.5, 0, 0) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 1 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.5,.45, 0) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 1 τ 2 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.5,.45,.37) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 1 τ 2 τ 3 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.5,.45,.67) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 4 τ 1 τ 2 τ 3 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.5,.65,.67) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 5 τ 4 τ 1 τ 2 τ 3 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.7,.65,.67) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 6 τ 5 τ 4 τ 1 τ 2 τ 3 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF (.7,.8,.67) τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 6 τ 7 τ 5 τ 4 τ 1 τ 2 τ 3 P 1 P 2 P 3 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Algorithm LUF τ 1 τ 2 τ 3 τ 4 τ 5 τ 6 τ 7 τ 8 0.5 0.45 0.37 0.3 0.2 0.2 0.15 0.1 τ 6 τ 7 τ 5 τ 8 τ 4 τ 1 τ 2 τ 3 P 1 U = 0.7 P 2 U = 0.8 P 3 U = 0.77 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 13 / 47
Optimality of Algorithm LUF Theorem If an optimal assignment for minimizing the maximal utilization results in at most two tasks on any processor, LUF is optimal. Proof The proof is omitted. If you are interested, you can take the proof as an exercise. The proof can be found from Graham s paper. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 14 / 47
What Happens if Algorithm LUF Fails? Assume that there exists a feasible task partition on M processors (for providing the analysis of resource augmentation). Suppose that Algorithm LUF fails when assigning task τ j and U m for m = 1, 2,..., M is the utilization of processor m before assigning τ j. Let U opt be the utilization of the optimal assignment for minimizing the maximal utilization for tasks {τ 1, τ 2,..., τ j }. By definition, 1 U opt j C i / i=1. M C j T j 1 Uopt: otherwise, there will be at most two tasks on any processors 3 in the optimal solution. this contradicts the assumption that Algorithm LUF fails as it is optimal. Since U m U m, we know that U m M U m m=1 M = j 1 C i / i=1. M Therefore, C j T j + U m C j T j (1 1 M ) + j i=1 C i / M ( 4 3 1 ) ( 4 U opt 3M 3 1 ). 3M Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 15 / 47
Algorithm LUF : Resource Augmentation Input: T, M; 1: re-index (sort) tasks such that C i C j T j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: find the processor m with the minimum task utilization, i.e., U m = min m U m ; 5: assign task τ i onto processor m, where U i U i + C i, {τ i }; 6: return task assignment T 1, T 2,..., T M with a speedup factor max{1, U m }; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 16 / 47
Properties of LUF Theorem If the input task set can be feasibly scheduled, Algorithm LUF derives a feasible task assignment/schedule by running the processors at a speedup factor by at most 4 3 1 3M. Theorem If the input task set cannot be feasibly scheduled by Algorithm LUF, the task set is not schedulable by running at a slow-down factor 1 4 3 1 3M. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 17 / 47
Algorithm LUF + : Resource Augmentation on Processors Input: T; 1: re-index (sort) tasks such that C i 2: T 1, U 1 0, ˆM 1; 3: for i = 1 to N, where N = T do C j T j for i < j; 4: find a processor m with U m + C i 1; 5: if no such a processor exists then 6: ˆM ˆM + 1, T ˆM, U ˆM 0; 7: m ˆM; 8: assign task τ i onto processor m, where U i U i + C i, {τ i }; 9: return task assignment T 1, T 2,..., T ˆM; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 18 / 47
Algorithm LUF + : Resource Augmentation on Processors Input: T; 1: re-index (sort) tasks such that C i 2: T 1, U 1 0, ˆM 1; 3: for i = 1 to N, where N = T do C j T j for i < j; 4: find a processor m with U m + C i 1; 5: if no such a processor exists then 6: ˆM ˆM + 1, T ˆM, U ˆM 0; 7: m ˆM; 8: assign task τ i onto processor m, where U i U i + C i, {τ i }; 9: return task assignment T 1, T 2,..., T ˆM; Properties The time complexity is O(N log N) or O(N 2 ), depending on the fitting approaches. The resulting solution is feasible on ˆM processors. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 18 / 47
Different Fitting Approaches 4: find a processor m with U m + C i 1; Fitting Strategies First-Fit: choose the feasible one with the smallest index Last-Fit: choose the feasible one with the largest index Best-Fit: choose the feasible one with the maximal utilization Worst-Fit: choose the feasible one with the minimal utilization Suppose that we want to assign a task with utilization equal to 0.1. 0.6 0.7 0.5 0.65 P 1 P 2 P 3 P 4 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 47
Different Fitting Approaches 4: find a processor m with U m + C i 1; Fitting Strategies First-Fit: choose the feasible one with the smallest index Last-Fit: choose the feasible one with the largest index Best-Fit: choose the feasible one with the maximal utilization Worst-Fit: choose the feasible one with the minimal utilization Suppose that we want to assign a task with utilization equal to 0.1. First 0.6Fit 0.7 0.5 0.65 P 1 P 2 P 3 P 4 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 47
Different Fitting Approaches 4: find a processor m with U m + C i 1; Fitting Strategies First-Fit: choose the feasible one with the smallest index Last-Fit: choose the feasible one with the largest index Best-Fit: choose the feasible one with the maximal utilization Worst-Fit: choose the feasible one with the minimal utilization Suppose that we want to assign a task with utilization equal to 0.1. First 0.6Fit 0.7 0.5 Last 0.65Fit P 1 P 2 P 3 P 4 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 47
Different Fitting Approaches 4: find a processor m with U m + C i 1; Fitting Strategies First-Fit: choose the feasible one with the smallest index Last-Fit: choose the feasible one with the largest index Best-Fit: choose the feasible one with the maximal utilization Worst-Fit: choose the feasible one with the minimal utilization Suppose that we want to assign a task with utilization equal to 0.1. First 0.6Fit Best 0.7Fit 0.5 Last 0.65Fit P 1 P 2 P 3 P 4 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 47
Different Fitting Approaches 4: find a processor m with U m + C i 1; Fitting Strategies First-Fit: choose the feasible one with the smallest index Last-Fit: choose the feasible one with the largest index Best-Fit: choose the feasible one with the maximal utilization Worst-Fit: choose the feasible one with the minimal utilization Suppose that we want to assign a task with utilization equal to 0.1. First 0.6Fit Best 0.7Fit Worst 0.5Fit Last 0.65Fit P 1 P 2 P 3 P 4 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 19 / 47
Algorithm LUF + : How Many Processors? Suppose that the processor used by Algorithm LUF + is ˆM 2. Let m be the processor with the minimum utilization. By the fitting algorithm, we know that U m + U m > 1 and U m U m all the other processors ms. If U m 0.5, by U m > 1 U m, we know that for τ i T C i U m + ˆM m=1,m m U m ˆM 1 ( ˆM 2)U m = ( ˆM 2)(1 U m )+1 If U m > 0.5, by U m U m, we know that Theorem τ i T C i U m + ˆM m=1,m m U m Algorithm LUF + is a 2-approximation algorithm. ˆM 2. ˆM 2. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 20 / 47
Algorithm LUF Revisit: Upper and Lower Bounds Let m be the processor with the maximum utilization among M processors. Let τ k be the last task that is added to m. Therefore, we know that U m U m C k T k for any other processor m. The lower bound of the maximum utilization to map T on M processor is LB max U m { C i max, τ i T τ i T M C i } U m + C M k m=1 U m + C k = T k M T k C i τ i T M Therefore, we reach that { } C C i i τ max max, i T = LB U m 2LB. τ i T M + C k T k 2LB. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 21 / 47
Outline Introduction to Multiprocessor Scheduling Partitioned Scheduling for Implicit-Deadline EDF Scheduling Partitioned Scheduling for Implicit-Deadline RM Scheduling Partitioned Scheduling for Constrained-Deadline DM Scheduling Partitioned Scheduling for Arbitrary-Deadline EDF Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 22 / 47
Largest-Utilization-First (LUF + ) - for RM Scheduling Input: T; 1: re-index (sort) tasks such that C i 2: T 1, U 1 0, n 1 0; ˆM 1; 3: for i = 1 to N, where N = T do C j T j for i < j; 4: find a processor m with U m + C i (n m + 1) 5: if no such a processor exists then 6: ˆM ˆM + 1, T ˆM, U ˆM 0, n ˆM 0; 7: m ˆM; 8: assign task τ i onto processor m, where U i U i + C i, {τ i }, n m n m + 1; 9: return task assignment T 1, T 2,..., T ˆM; ) (2 1 n m +1 1 ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 23 / 47
Largest-Utilization-First (LUF + ) - for RM Scheduling Input: T; 1: re-index (sort) tasks such that C i 2: T 1, U 1 0, n 1 0; ˆM 1; 3: for i = 1 to N, where N = T do C j T j for i < j; 4: find a processor m with U m + C i (n m + 1) 5: if no such a processor exists then 6: ˆM ˆM + 1, T ˆM, U ˆM 0, n ˆM 0; 7: m ˆM; 8: assign task τ i onto processor m, where U i U i + C i, {τ i }, n m n m + 1; 9: return task assignment T 1, T 2,..., T ˆM; Properties The time complexity is O((N + M) log(n + M)) ) (2 1 n m +1 1 ; If a solution is derived, the task assignment is feasible by using RM. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 23 / 47
A Simple Analysis ( ) The schedulability test U m + C i (n m + 1) 2 1 n m +1 1 is upper bounded by 69.3%. According to the above analysis for EDF, we can also conclude that the utilization is at least 0.693 ˆM 2. Therefore, the approximation factor of LUF + is 2 0.693 2.887. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 24 / 47
A More Precise Analysis If ˆM is 1, we know that τ i T C i N(2 1 N 1). Suppose that the processor used by Algorithm LUF + is ˆM 2. Let k be the index of the task, at which processor ˆM is allocated when running LUF +. We only look at the iteration when i is k. Therefore, U k + ) U i > (n m + 1) (2 nm+1 1 1, m = 1,..., ˆM 1. τ i T m By the sorting of the tasks, we also know that U i U k for any i k. This also implies that ( ) τ i T m U i > n m 2 nm+1 1 1. ) x (2 x+1 1 1 is an increasing function of x when x 1. Let q be the minimum number of tasks assigned on a processor before task τ k, i.e., 1 q n m, m = 1,..., ˆM 1. The approximation factor is 2 + 1 since k 1 U k + U i > (1 + ( ˆM ) 1)q) (2 q+1 1 1 ˆM( 2 1) 0.414 ˆM. i=1 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 25 / 47
Remarks (Augmenting the Number of Processors) Survey by Davis and Burns (ACM Computing Surveys, 2011): Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 26 / 47
Outline Introduction to Multiprocessor Scheduling Partitioned Scheduling for Implicit-Deadline EDF Scheduling Partitioned Scheduling for Implicit-Deadline RM Scheduling Partitioned Scheduling for Constrained-Deadline DM Scheduling Partitioned Scheduling for Arbitrary-Deadline EDF Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 27 / 47
Definition and Theorem Recalled For a task set, we say that the task set is with constrained deadline when the relative deadline D i is no more than the period, i.e., D i, for every task τ i, or arbitrary deadline when the relative deadline D i could be larger than the period for some task τ i. Theorem A task set T of independent, preemptable, periodic tasks can be feasibly scheduled (under EDF) on one processor if and only if t 0, n i=1 { max 0, t + Ti D i } C i t. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 28 / 47
Problem Definition Partitioned Scheduling Given a set T of tasks with arbitrary deadlines, the objective is to decide a feasible task assignment onto M processors such that all the tasks meet their timing constraints, where C i is the execution time of task τ i on any processor m. I will only focus on speed-up (resource augmentation) factors for the rest of the slides. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 29 / 47
Shortest-Relative-Deadline First (SDF) with DM (SDF+DM) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 30 / 47
Shortest-Relative-Deadline First (SDF) with DM (SDF+DM) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: for m = 1 to M do 5: if task τ i can be feasibly scheduled with T m under DM scheduling then 6: assign task τ i onto processor m and T m T m {τ i }; 7: break; 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 30 / 47
Shortest-Relative-Deadline First (SDF) with DM (SDF+DM) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: for m = 1 to M do 5: if task τ i can be feasibly scheduled with T m under DM scheduling then 6: assign task τ i onto processor m and T m T m {τ i }; 7: break; 8: if τ i is not assigned then 9: return The task assignment fails ; 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 30 / 47
Shortest-Relative-Deadline First (SDF) with DM (SDF+DM) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: for m = 1 to M do 5: if task τ i can be feasibly scheduled with T m under DM scheduling then 6: assign task τ i onto processor m and T m T m {τ i }; 7: break; 8: if τ i is not assigned then 9: return The task assignment fails ; 10: return feasible task assignment T 1, T 2,..., T M ; The used test can be an exact test (by using TDA) or a utilization-based analysis. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 30 / 47
Constrained-Deadline: Failure when Using TDA Suppose that task τ k is the first task that fails to be assigned on any of the M processors. Let T be the set {τ 1, τ 2,..., τ k 1 }. Therefore, m, t, with 0 < t D k, C k + τ i T m t C i > t. By taking a summation of all the m = 1, 2,..., M inequalities with respect to any t, we have t with 0 < t D k, MC k + t C i > Mt. By taking the negation, we know that if τ i T t with 0 < t D k, and C k + τ i T t C i t, (1) M then the SDF+DM by using TDA should succeed to assign task τ k on one of the M processors. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 31 / 47
Constrained-Deadline: Schedulability Test for TDA This is basically very similar to TDA with a minor difference by dividing the higher-priority workload by M. Testing the schedulability condition of task τ k can be done by using the same strategy used in the k 2 U framework. We classify the k 1 tasks in T into two subsets. T 1 consists of the tasks in T with period smaller than D k. T 2 consists of the tasks in T with period larger than or equal to D k. Let C k be defined as follows: C k = C k + M. τ i T 2 C i Now, we can rewrite the condition as follows: if t with 0 < t D k and C k + τ i T 1 t C i M t, then SDF+DM by using TDA should succeed to assign task τ k on one of the M processors. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 32 / 47
Recall k-point Effective Schedulability Test: k 2 U Suppose that {t 1, t 2,... t k } are given. Definition A k-point effective schedulability test is a sufficient test by verifying the existence of t j {t 1, t 2,... t k } with t 1 t 2 t k such that k 1 C k + α i t i U i + i=1 j 1 β i t i U i t j, (2) where C k > 0, α i > 0, U i > 0, and β i > 0 are dependent upon the setting of the task models and task τ i. Lemma [Lemma 1] For a given k-point effective schedulability test of a scheduling algorithm, in which 0 < α i α, and 0 < β i β for any i = 1, 2,..., k 1, 0 < t k, task τ k is schedulable by the scheduling algorithm if the following condition holds C k t k i=1 α β + 1 k 1 j=1 (βu j + 1) α β. (3) Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 33 / 47
Constrained-Deadline: Utilization-Base Test for TDA Theorem If (1 + U i M ) 2, τ i T 1 1 + C k D k then a constrained-deadline task τ k is schedulable under SDF+DM by using TDA. Proof Let t i be Tk for τ i T 1. When using the k 2 U framework, we can reach the conclusion that α i = 1 M, and 0 < β i 1 M t k is D k and C k (in the previous lemma) is C k. By adopting the above lemma, we reach the conclusion. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 34 / 47
Using Utilization-Based Test in SDF+DM Instead of using the exact test, we can also use the utilization-based test (in the hyperbolic form) for deadline-monotonic scheduling (see slide 30 in 11-k2u.pdf). Surprisingly, the result is the same as the case by using TDA analysis. One of your exercise assignments is for the special case by using the hyperbolic form in the schedulability test for RM. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 35 / 47
Summary of Existing Results partitioned with EDF partitioned with DM implicit deadlines constrained deadlines arbitrary deadlines 4 1 3 3M 1969) (Graham (1 + ɛ) (Hochbaum/Shmoys 1987) (bin-packing) 7 4 (Burchard et al. 1995) (bin-packing) 1.5 (Rothvoß2009) 3 1 (Baruah/Fisher 2006) 4 2 (Baruah/Fisher 2005) M M 2.6322 (Chen/Chakraborty 2011) 1 M 3 1 M (Baker/Fisher/Baruah 2009) 3 1 (Chen/Chakraborty 2011) M 4 2 (Baker/Fisher/Baruah 2009) M 2.84306 (Chen 2015) 3 1 (Chen 2015) M The above factors are for speed-up factors, except the two results in partitioned RM scheduling. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 36 / 47
Outline Introduction to Multiprocessor Scheduling Partitioned Scheduling for Implicit-Deadline EDF Scheduling Partitioned Scheduling for Implicit-Deadline RM Scheduling Partitioned Scheduling for Constrained-Deadline DM Scheduling Partitioned Scheduling for Arbitrary-Deadline EDF Scheduling Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 37 / 47
Demand Bound Function Revisit for EDF Define demand bound function dbf (τ i, t) as { t + Ti D i dbf (τ i, t) = max 0, } C i = max { 0, t Di We need approximation to enforce polynomial-time schedulability test. { 0 if t < dbf Di (τ i, t) = ( t D i + 1)C i otherwise. } + 1 C i. dbf (τ i, t) 0 1 2 3 4 5 6 7 8 9 10 11 12 t Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 38 / 47
Demand Bound Function Revisit for EDF Define demand bound function dbf (τ i, t) as { t + Ti D i dbf (τ i, t) = max 0, } C i = max { 0, t Di We need approximation to enforce polynomial-time schedulability test. { 0 if t < dbf Di (τ i, t) = ( t D i + 1)C i otherwise. } + 1 C i. dbf (τ i, t) dbf (τ i, t) 0 1 2 3 4 5 6 7 8 9 10 11 12 t Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 38 / 47
Demand Bound Function Revisit for EDF Define demand bound function dbf (τ i, t) as { t + Ti D i dbf (τ i, t) = max 0, } C i = max { 0, t Di We need approximation to enforce polynomial-time schedulability test. { 0 if t < dbf Di (τ i, t) = ( t D i + 1)C i otherwise. } + 1 C i. dbf (τ i, t) dbf (τ i, t) dbf (τ i, t) 2dbf (τ i, t) dbf (τ i, t) 0 1 2 3 4 5 6 7 8 9 10 11 12 t Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 38 / 47
Shortest Relative-Deadline First (SDF+EDF) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 39 / 47
Shortest Relative-Deadline First (SDF+EDF) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: for m = 1 to M do 5: if C i + τ j T m C j T j 1 and C i + τ j T m dbf (τ j, D i ) D i then 6: assign task τ i onto processor m and T m T m {τ i }; 7: break; 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 39 / 47
Shortest Relative-Deadline First (SDF+EDF) Input: T, M; 1: re-index (sort) tasks such that D i D j for i < j; 2:, U i 0, m = 1, 2,..., M; 3: for i = 1 to N, where N = T do 4: for m = 1 to M do 5: if C i + τ j T m C j T j 1 and C i + τ j T m dbf (τ j, D i ) D i then 6: assign task τ i onto processor m and T m T m {τ i }; 7: break; 8: if τ i is not assigned then 9: return The task assignment fails ; 10: return feasible task assignment T 1, T 2,..., T M ; Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 39 / 47
Feasibility Theorem If the tasks are partitioned successfully by using SDF+EDF Partition, EDF can feasibly schedule the tasks. This is due to the feasibility analysis of the linear approximation of the demand bound functions. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 40 / 47
When Is SDF+EDF Always Successful? Define that δ max is the maximum density, i.e., max τi T C i D i. µ max is the maximum utilization, i.e., max τi T C i. δ max and µ max are both less than or equal to 1. δsum is the maximum total dbf density, i.e., max t>0 τ i T dbf (τ i,t) t. µsum is the total utilization, i.e., τ i T C i. Theorem Any sporadic task set is successfully scheduled by SDF+EDF on M identical processors, when M 2δ sum δ max 1 δ max + µ sum µ max 1 µ max. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 41 / 47
Proof of Schedulability Suppose that τ k is not able to be assigned on any processor by SDF+EDF. Either C k T k + C j τ j T m T j > 1 or C k + τ j T dbf (τ j, D k ) > D k. m Suppose that among M processors, there are M 1 processors, denoted by set M 1, with C k + τ j T dbf (τ j, D k ) > D k. m Therefore, by summing the inequalities together, we have M 1 C k + dbf (τ j, D k ) > M 1 D k. τ j T m and m M 1 2dbf (τ j, D k ) > M 1 (D k C k ) τ j T\{τ k } 2dbf (τ j, D k ) > M 1 (D k C k ) + C k τ j T divided by D k τ j T 2dbf (τ j, D k ) D k 2δsum > M 1 D k C k D k By above, we know that M 1 < 2δ sum C k D k. 1 C k D k > M 1 D k C k D k + C k D k + C k D k Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 42 / 47
Proof of Schedulability M 2 = M M 1 processors are purely with C k T k + C j τ j T m T j > 1. Similarly, M 2 < µ sum C k T k. 1 C k T k As a result, it can be shown that M = M 1 + M 2 < 2δ sum δ max 1 δ max + µ sum µ max 1 µ max. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 43 / 47
Resource Augmentation Theorem If a sporadic task set is schedulable on M identical processors, SDF+EDF will successfully partition this task set upon a platform comprised of M processors that are each (4 2 M ) times as fast as the original. Proof The necessary condition to be schedulable on M identical processors is δ max 1, µ max 1, µsum M, and δsum M. If speeding up by 1 γ satisfies M 2δ sum δmax 1 δ max by applying SDF+EDF. Therefore, + µ sum µmax 1 µ max, it is feasible 2δsum δ max + µ sum µ max 2Mγ γ + Mγ γ 1 δ max 1 µ max 1 γ 1 γ If M 3Mγ 2γ 1 γ, the schedulability is enforced. 4 2 M 1 γ. = 3Mγ 2γ 1 γ Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 44 / 47
SDF+EDF for Constrained Deadlines Theorem Any sporadic task set with constrained deadlines is successfully scheduled by SDF+EDF on M identical processors, when M 2δ sum δ max 1 δ max. Theorem If a sporadic task set with constrained deadlines is schedulable on M identical processors, SDF+EDF will successfully partition this task set upon a platform comprised of M processors that are each (3 1 M ) times as fast as the original. Main difference: Condition C i + τ j T m enforced when C i + τ j T m dbf (τ j, D i ) D i holds. ( M 2 is always 0). C j T j 1 in Step 5 is always Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 45 / 47
Feasibility Theorem [Fisher and Baruah, RTSS 2005] The resource augmentation factor for SDF+EDF has a 4 2 M resource augmentation factor for tasks with arbitrary deadlines a 3 1 M resource augmentation factor for tasks with constrained deadlines Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 46 / 47
Feasibility Theorem [Fisher and Baruah, RTSS 2005] The resource augmentation factor for SDF+EDF has a 4 2 M resource augmentation factor for tasks with arbitrary deadlines a 3 1 M resource augmentation factor for tasks with constrained deadlines Theorem [Chen and Chakraborty, RTSS 2011] The SDF+EDF has a 3 1 M resource augmentation factor for tasks with arbitrary deadlines a 3e 1 e 1 M 2.6322 1 M resource augmentation factor for tasks with constrained deadlines Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 46 / 47
Summary of Existing Results partitioned with EDF partitioned with DM implicit deadlines constrained deadlines arbitrary deadlines 4 1 3 3M 1969) (Graham (1 + ɛ) (Hochbaum/Shmoys 1987) (bin-packing) 7 4 (Burchard et al. 1995) (bin-packing) 1.5 (Rothvoß2009) 3 1 (Baruah/Fisher 2006) 4 2 (Baruah/Fisher 2005) M M 2.6322 (Chen/Chakraborty 2011) 1 M 3 1 M (Baker/Fisher/Baruah 2009) 3 1 (Chen/Chakraborty 2011) M 4 2 (Baker/Fisher/Baruah 2009) M 2.84306 (Chen 2015) 3 1 (Chen 2015) M The above factors are for speed-up factors, except the two results in partitioned RM scheduling. Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 47 / 47