Task Allocation End-to-End Scheduling Framework Bin-Packing Heuristics: First-Fit 1. Task allocation: bind tasks to processors • Subtasks assigned in arbitrary order 2. Synchronization protocol: enforce • To allocate a new subtask T i,j precedence constraints • If T i,j can be added to an existing processor P l (1 ≤ l ≤ k) without exceeding its capacity, allocate T i,j 3. Subdeadline assignment to P k 4. Schedulability analysis • Else add a new processor P k+1 and allocate T i,j to it. Chenyang Lu CSE 467S 1 Chenyang Lu CSE 467S 2 Task Allocation to Minimize Performance limit of First-Fit Communication Cost • Number of processors needed: m/m 0 -> 1.7 as • Inter-subtask communication can introduce m 0 -> ∞ overhead and delay • m: number of processors needed under First-Fit • E.g., Remote method invocation is more expensive and slower than local invocations • m 0 : minimum number of processors needed • Goal: minimize communication cost subject to • First-Fit can always find a feasible allocation processor capacity constraints on m processors if total subtask utilization is no greater than m(2 1/2 -1) = 0.414m • Two steps • Assuming fixed-priority scheduling, identical • Partition subtasks into groups processors • Allocate groups to processors Chenyang Lu CSE 467S 3 Chenyang Lu CSE 467S 4 Synchronization Protocols End-to-End Scheduling Framework 1. Task allocation: bind tasks to processors • Requirements 2. Synchronization protocol: enforce • Correct: Enforce precedence constraints precedence constraints • Allow accurate schedulability analysis 3. Subdeadline assignment • Low worst-case response time 4. Schedulability analysis • Low overhead • Reduce jitter • Low average response time Chenyang Lu CSE 467S 5 Chenyang Lu CSE 467S 6
Greedy Protocol Critique on Greedy Protocol • Release job J i,j;k as soon as J i,j-1;k is completed • Correctness • Subtasks may not be periodic under a greedy • Allow schedulability analysis protocol • Worst-case response time • Difficult for schedulability analysis • Overhead • Higher-priority tasks arrive early � high worst- • Jitter case response time for lower-priority tasks • Low average response time • Jitter can accumulate over multiple hops Chenyang Lu CSE 467S 7 Chenyang Lu CSE 467S 8 Critique on PMP Phase-Modification Protocol (PMP) • Incorrect if tasks have release jitter or • Idea: Enforce periodic release based on worst-case response time overrun • Every job J i,j;k is released at time • Allow schedulability analysis • Low worst-case response time ∑ j − 1 s + ( k − 1 ) p + w • Overhead: i i i , l l 1 = • No explicit synchronization • s i : start time of job J i,1;1 • Depend on global clock synchronization • w il : worst case response time of T il • Low jitter • Assumptions • High average response time • Require upper bound on the response time of all subtasks • Require global clock Chenyang Lu CSE 467S 9 Chenyang Lu CSE 467S 10 Modified PMP Critique on MPMP • Correct • Same as PMP except • Allow accurate schedulability analysis • A subtask cannot be released unless its • Low worst-case response time predecessor has been completed • Overhead • Assumptions • require explicit synchronization • Require upper bound on the response time of all • Does not require global clock sync subtasks • Low jitter • Require a sync message from predecessor • High average response time indicating its predecessor has been completed • Does not require global clock synchronization • Indicate “ahead time” in sync message Chenyang Lu CSE 467S 11 Chenyang Lu CSE 467S 12
Release Guard RG Assumptions • If processor never idles since last release • Assumptions time r i,k+1;j-1 • Does not require upper bound on the response time of all subtasks • release J i,k+1;j either when it receives a sync message from J i,k;j or at time r i,k+1;j-1 +p i , whichever • Does not require global clock synchronization is later • Work best for loosely coupled system! • Else: • release J i,k+1;j 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 CSE 467S 13 Chenyang Lu CSE 467S 14 Critique on Release Guard Score Board: Sync protocols • Correct Correct Sched WCRT Avg RT Global Jitter Info. • Allow accurate schedulability analysis Greedy Y N H L L H • Low worst-case response time PMP N Y L H H L • Overhead MPMP Y Y L H H L • require explicit synchronization • Does not require global clock synchronization RG Y Y L M/H L H/L • Low jitter (if rule 2 is not used) •Use MPMP or RG if • Improved average response time (if rule 2 is •Information about all tasks are available a priori used) •System has global clock sync •Otherwise only RG can be used Chenyang Lu CSE 467S 15 Chenyang Lu CSE 467S 16 Subdeadline assignment Subdeadline Assignment Heuristics • Notations • Subdeadline � priorities under EDF & DM � • (Relative) deadline d i of task T i response times • (Relative) subdeadline d ij of subtask T ij (1 ≤ j ≤ n(i)) • Optimal subdeadline assignment is NP-hard • Slack of subtask T ij : s ij = d ij - e ij • Offline: heuristic search algorithms • Ultimate Deadline (UD): d ij = d i • Online: simpler heuristics • But some subtasks must finish earlier than the end-to-end deadline! ∑ ∑ j − 1 n ( i ) • Effective Deadline (ED): d d d e = − − ij i ik ik k 1 k j 1 = = + • Assign all slack to 1 st subtask Chenyang Lu CSE 467S 17 Chenyang Lu CSE 467S 18
More Heuristics Scheduling • Proportional Deadline (PD): • Single processor e • Periodic tasks ij d d = ∑ = ij i n ( i ) e • Fixed priority vs. dynamic priority ik k 1 • Assign slack proportionally to execution time • Deadline vs. period • Normalized Proportional Deadline • Resource contention • Aperiodic + periodic tasks e u ( V ) ij i , j d = d • Distributed systems ∑ = ij i n ( i ) ( e u ( V )) ik i , k k 1 • Assign more slack to subtasks on busier processors Chenyang Lu CSE 467S 19 Chenyang Lu CSE 467S 20 Scheduling Aperiodic Tasks Background Scheduling • Treat aperiodic tasks as lowest-priority tasks • Hybrid task set: periodic tasks + aperiodic tasks • Problem: Arrival time is unknown • Advantages • Sporadic task with a hard deadline • Simple • Inter-arrival time must be lower bounded • Aperiodic tasks has no impact on the schedulability of periodic tasks • Schedulability analysis: treated as a periodic task with period = minimum inter-arrival time • Disadvantage • Aperiodic task with a soft deadline • Aperiodic tasks have very long response times • Possibly unbounded inter-arrival time when the utilization of periodic tasks is high • Goals: • Acceptable only if • maintain hard guarantees on periodic tasks • System is not busy • Reduce response time of aperiodic tasks • Aperiodic tasks can tolerate long delays Chenyang Lu CSE 467S 21 Chenyang Lu CSE 467S 22 Polling Server Schedulability • Polling server (PS): a periodic task used to • The aperiodic requests have the same impact serve aperiodic requests on periodic tasks as a periodic task. • Period: p s • n tasks with m PS’: U p + U s ≤ U b (n+m) • Capacity: c s • Can have multiple PS’ (with different periods) • Rules for different aperiodic requests • Released periodically with period p s • Serves any pending aperiodic requests • Disadvantage: If an aperiodic request • Suspends itself if “misses” the execution of PS, it has to wait • it has used up its capacity, or till the next period � long response time. • no aperiodic request is pending • Server capacity is replenished to c s in the next period Chenyang Lu CSE 467S 23 Chenyang Lu CSE 467S 24
Utilization Bound with DS Deferrable Server (DS) ⎡ ⎤ 1 n / ⎛ ⎞ U 2 + ⎜ ⎟ • Unlike PS, DS preserves unused capacity until the end • Under RMS ⎢ ⎥ s U = U + n ⎜ ⎟ − 1 b s ⎢ ⎥ of the current period ⎝ 2 U 1 ⎠ + ⎣ ⎦ s • Better response to aperiodic requests • However, DS’ impact on periodic tasks is different ⎛ ⎞ U + 2 • As n � ∞ : ⎜ ⎟ from an periodic task s U U ln = + ⎜ ⎟ b s ⎝ ⎠ 2 U + 1 s • When U s = 0.186, min U b = 0.652 ⎛ ⎞ U + 2 • System is schedulable if ⎜ ⎟ U ln s ≤ ⎜ ⎟ p ⎝ 2 U 1 ⎠ + s Chenyang Lu CSE 467S 25 Chenyang Lu CSE 467S 26 Pointers • Class hand-out • Rate Monotonic • A Practitioner's Handbook for Real-Time Analysis: Guide to Rate Monotonic Analysis for Real-Time Systems, Klein et. al. • EDF • Deadline Scheduling for Real-Time Systems: EDF and Related Algorithms, Stankovic et. al. • General • Hard Real-Time Computing Systems, G. Buttazzo. • Real-Time Systems, Jane Liu. Chenyang Lu CSE 467S 27
Recommend
More recommend