What if a system is unschedulable? • Reduce execution times of tasks. • Reduce blocking factors. End-to-End Scheduling in • Change periods in requirements. Distributed Real-Time Systems • Get a faster CPU. • Replace with software components with hardware (ASIC, FPGA) components • Multi-processor and distributed systems. Chenyang Lu 2 1 Multi-processor System Distributed System • Tight coupling among processors • Loose coupling among processors • E.g., Dual-processor Sun workstations • Each processor has its own scheduler • Communicate through shared memory and on- • Costly to acquire states of other processors board buses • Broad range of systems • Scheduled by a common scheduler/OS • Processor boards mounted on a VME bus • Global scheduling • Automobile: hundreds of processors connected • Partitioned scheduling through a Control Area Network (CAN) • Air traffic control system on a wide area network • States of all processors available to each other Chenyang Lu 3 Chenyang Lu 4 End-to-End Task Model Notation • An (end-to-end) task is composed of multiple • T i = {T i,1 , T i,2 , … , T i,n(i) } subtasks running on multiple processors • n(i): the number of subtasks of T i • Message • Precedence constraint: Job J i,j cannot be • Event released until J i,j-1 is completed. • Remote method invocation • Subtasks are subject to precedence constraints • Task = a chain/tree/graph of subtasks Chenyang Lu 5 Chenyang Lu 6
End-to-End Deadline End-to-End Scheduling Framework • A task is subject to an end-to-end 1. Task allocation: bind tasks to processors deadline 2. Synchronization protocol: enforce precedence constraints • Does not care about the response time of a 3. Subdeadline assignment particular subtask 4. Schedulability analysis • How to guarantee end-to-end deadlines on a distributed system? Chenyang Lu 7 Chenyang Lu 8 Bin-Packing Formulation Task Allocation • Load code (e.g., objects) to processors • Pack subtasks to bins (processors) with limited capacity • Strategies • Size of a subtask T i,j : u i,j = C i,j /P i • Offline, static allocation • Capacity of each bin is its utilization bound • Allocate a task when it arrives • e.g., 0.69 (RMS) or 1 (EDF) under certain assumptions • Goal: minimize the number of bins subject to the • Re-allocate (migrate) a task after it starts capacity constraints • NP-hard: heuristics needed • Ignore communication cost • Assume every subtask is periodic Chenyang Lu 9 Chenyang Lu 10 Bin-Packing Heuristics: First-Fit Performance Limit of First-Fit • Subtasks assigned in arbitrary order • Number of processors needed: m/m 0 -> 1.7 as m 0 -> ∞ • To allocate a new subtask T i,j • m: number of processors needed under First-Fit • If T i,j can be added to an existing processor P l (1 ≤ l ≤ k) • m 0 : minimum number of processors needed without exceeding its capacity, allocate T i,j to P k • Else add a new processor P k+1 and allocate T i,j to it. • First-Fit can always find a feasible allocation on m processors if total subtask utilization is no greater than m(2 1/2 -1) = 0.414m • Assuming identical processors Chenyang Lu 11 Chenyang Lu 12
Minimize Communication Cost End-to-End Scheduling Framework • Inter-subtask communication can 1. Task allocation: bind tasks to processors introduce overhead and delay 2. Synchronization protocol: enforce precedence • RPC is slower than local invocations constraints • Goal: minimize communication cost 3. Subdeadline assignment subject to processor capacity constraints 4. Schedulability analysis • Two steps • Partition subtasks into groups • Allocate groups to processors Chenyang Lu 13 Chenyang Lu 14 Sync Protocols: Requirements Greedy Protocol • Correct: Enforce precedence constraints • Release job J i,j;k as soon as J i,j-1;k is completed • Subtasks may not be periodic under a greedy • Allow schedulability analysis protocol • Low worst-case response time • Difficult for schedulability analysis • Low overhead • Higher-priority tasks arrive early � high worst-case response time for lower-priority tasks • Reduce jitter • Jitter can accumulate over multiple hops • Low average response time Chenyang Lu 15 Chenyang Lu 16 Critique on Greedy Protocol Phase-Modification Protocol (PMP) • Correct • Idea: Enforce periodic release based on worst-case response time • Low overhead • Every job J i,j;k is released at time • Low average response time ∑ − φ + − + j 1 ( k 1 ) P w i i = i , l • High jitter l 1 • Difficult schedulability analysis • w il : worst case response time of T il • Assumptions • High worst-case response time • Require upper bound on the response time of all subtasks • Require global clock Chenyang Lu 17 Chenyang Lu 18
Critique on PMP Modified PMP • Incorrect if tasks have release jitter or overrun • Same as PMP except • Allow schedulability analysis • A subtask cannot be released unless its predecessor has been completed • Low worst-case response time • Require upper bound on the response times of • Overhead all subtasks • No explicit synchronization • Depend on global clock synchronization • Require a sync message from predecessor • Low jitter indicating its predecessor has been completed • High average response time • Does not require global clock synchronization • Indicate “ahead time” in sync message Chenyang Lu 19 Chenyang Lu 20 Critique on MPMP Release Guard • Correct if processor never idles since last release • Allow accurate schedulability analysis time r i,j;k • Low worst-case response time • release J i,j;k+1 either when it receives a sync • Overhead message from J i,j;k or at time r i,j;k-1 +P i , • require explicit synchronization whichever is later • Does not require global clock sync • Low jitter else • High average response time • release J i,j;k+1 when receiving a sync message or when processor becomes idles, whichever is later. • Improve average response time without affecting schedulability at the cost of jitter Chenyang Lu 21 Chenyang Lu 22 Non-Assumptions Critique on Release Guard • Does not require upper bound on the response • Correct time of all subtasks • Allow accurate schedulability analysis • Does not require global clock synchronization • Low worst-case response time • Overhead • Work best for loosely coupled system! • require explicit synchronization • Does not require global clock synchronization • Low jitter (if rule 2 is not used) • Improved average response time (if rule 2 is used) Chenyang Lu 23 Chenyang Lu 24
Score Board: Sync Protocols Subdeadline Assignment Correct Sched. WCRT Avg RT Global Jitter • Subdeadline � priorities under EDF & DM � Info. response times Greedy Y N H L L H • Optimal subdeadline assignment is NP-hard PMP N Y L H H L • Offline: heuristic search algorithms MPMP Y Y L H H L • Online: simpler heuristics RG Y Y L M/H L H/L •Use MPMP or RG if •Information about all tasks are available a priori •System has global clock sync •Otherwise only RG can be used Chenyang Lu 25 Chenyang Lu 26 More Heuristics Subdeadline Assignment Heuristics • Proportional Deadline (PD): • Notations • (Relative) deadline d i of task T i C = ij • (Relative) subdeadline d ij of subtask T ij (1 ≤ j ≤ n(i)) D D ∑ = ij i n ( i ) • Slack of subtask T ij : s ij = D ij - C ij C ik k 1 • Assign slack proportionally to execution time • Ultimate Deadline (UD): D ij = D i • Normalized Proportional Deadline • But some subtasks must finish earlier than the end-to-end deadline! C u ( V ) = ij i , j D D ∑ = ij i n ( i ) ∑ ∑ − = − j 1 − n ( i ) ( C u ( V )) • Effective Deadline (ED): d d d e ik i , k ij i = ik = + ik k 1 k 1 k j 1 • Assign all slack to 1 st subtask • Assign more slack to subtasks on busier processors Chenyang Lu 27 Chenyang Lu 28
Recommend
More recommend