1 / 54

Paper Discussion

C. L. Liu and James W. Layland , "Scheduling Algorithms for M u ltiprogramming in a Hard-Real-Time Environment", JACM, Vol 20, No. 1, pp. 46--61, 1973

tacy
Télécharger la présentation

Paper Discussion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C. L. Liu and James W. Layland, "Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment", JACM, Vol 20, No. 1, pp. 46--61, 1973 Chihg-Chih Han, Kwei-Jay Lin and Chao-JuHou, "Distance-Constrained Scheduling and Its Applications to Real-Time Systems", IEEE Trans. on Computers, Vol 45, No. 7, pp. 814-826 1996 Paper Discussion /52

  2. No non-time-critical jobs Pure Process Control Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment C. L. Liu and James W. Layland, "Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment", JACM, Vol 20, No. 1, pp. 46--61, 1973 /52

  3. (A1) The requests for all tasks for which hard deadlines exist are periodic, with constant interval between requests. (A2) Deadlines consist of run-ability constraints only--i.e, each task must be completed before the next request for it occurs. (A3) The tasks are independent in that requests for a certain task do not depend on the initiation or the completion of requests for other tasks. (A4) Run-time for each task is constant for that task and does not vary with time. Run-time here refers to the time which is taken by a processor to execute the task without interruption. (A5) Any nonperiodic tasks in the system are special; they are initialization or failure-recovery routines; they displace periodic tasks while they themselves are being run, and do not themselves have hard, critical deadlines. Assumptions /52

  4. start finish preempt resume Real-Time Task Model • Periodic Task Model • parameters are known a priori request time ready time deadline period worst-case execution time • Predictability vs. Schedulability • high predictability and schedulability • easy-to-check schedulability condition /52

  5. Scheduling Approaches • Time-Driven Scheduling Approach • widely used • inflexible, efficient • large space needed • e.g. cyclic executive • Priority-Driven Scheduling Approach • dynamic-priority • e.g. earliest deadline first • fixed-priority • e.g. rate monotonic /52

  6. job: an instance of a task deadline: next request time of the same task overflow at time t: t is a deadline of unfulfilled request feasible: scheduled with no overflow (schedulable) response time: time span from request to finish critical instance: an instance when a request will have the largest response time critical time zone: time interval from a critical instance to its finish time Terms in Scheduling /52

  7. THEOREM 1. A critical instant for any task occurs whenever the task is requested simultaneously with requests for all higher priority tasks. A scheduling algorithm is feasible if all tasks can be fulfilled at their critical instants. A Fixed Priority Scheduling Algorithm /52

  8. THEOREM 2. If a feasible priority assignment exists for some task set, the rate-monotonic priority assignment is feasible for that task set. A Fixed Priority Scheduling Algorithm (cont.) /52

  9. THEOREM 2. If a feasible priority assignment exists for some task set, the rate-monotonic priority assignment is feasible for that task set. Optimality /52

  10. THEOREM 3. For a set of two tasks with fixed priority assignment, the least upper bound to the processor utilization factor is U = 2 (2 ½ - 1). case 1 case 2 T1 T2 T1 T2 A Fixed Priority Scheduling Algorithm (cont.) /52

  11. The minimum U occurs at the boundary of two cases T1 T2 T1 T2 A Fixed Priority Scheduling Algorithm (cont.) /52

  12. An easy-to-check schedulability condition Least Upper Bound 1 n=2, 0.83 n=3, 0.78 n=, 0.69 /52

  13. THEOREM 4. For a set of m tasks with fixed priority order, and the restriction that the ratio between any two request periods is less than 2, the least upper bound to the processor utilization factor is U = m(2 1/m - 1). find optimal conditions when optimality exists or if it is optimal and condition A does not hold conflicts, so A must be true. solve equations at optimal condition derive bound relax assumption A Fixed Priority Scheduling Algorithm (cont.) /52

  14. T1 T1 T2 T2 T1 T2 T1 T2 /52

  15. /52

  16. THEOREM 5. For a set of m tasks with fixed priority order, the least upper bound to processor utilization is U = m(2 1/m - 1). The bound of special case is tighter than general case. Rate Monotonic Priority Assignment The smaller the period, the higher the priority. Rate Monotonic Scheduling Algorithm generate the whole schedule on-line off-line priority queue 100%? A Fixed Priority Scheduling Algorithm (cont.) /52

  17. THEOREM 6. When the deadline driven scheduling algorithm is used to schedule a set of tasks on a processor, there is no processor idle time prior to an overflow. A Deadline Driven Scheduling Algorithm /52

  18. THEOREM 7. For a given set of m tasks, the deadline driven scheduling algorithm is feasible if and only if U  1. necessary condition (only if) if feasible, the computation demand  processor time sufficient condition if U 1, and not feasible case 1 0 T T1 T2…Tm all bi beyond T A Deadline-Driven Scheduling Algorithm (cont.) /52

  19. case 2 some bi were carried out before T Sufficient Condition (cont.) /52

  20. ? A mixed Scheduling Algorithm /52

  21. video server • inter-frame distance must be less than 33ms • robot arm movement • needs steady and smooth operations • satellite/cellular phone tracking • service in constant time interval • more predictable inter-execution time than the periodic task(PT) model • worst inter-execution time for PT is 2xperiod-ei Distance-Constrained Task Model Chihg-Chih Han, Kwei-Jay Lin and Chao-JuHou, "Distance-Constrained Scheduling and Its Applications to Real-Time Systems", IEEE Trans. on Computers, Vol 45, No. 7, pp. 814-826, 1996 /52

  22. Given a multiset A={a1, a2, ... ,an}, aiÎ N Find an infinite sequence of symbols from {1, 2, ... , n} such that at least one symboli within any interval of aisymbols A={2,3} ® 1 2 121 2 ... ® 1 121 12 ... A unit-time schedule Pinwheel Problem /52

  23. 6 6 6 6 6 6 6 T1 (1,6) T2 (3,6) T3 (2,12) T4 (2,12) Pinwheel Schedule 12 0 11 1 T1 10 2 T4 T2 9 3 T2 8 T3 4 T1 7 5 6 0 1 2 3 4 5 6 7 8 9 10 11 12 Pinwheel schedule /52

  24. Pinwheel any numbers ®multiples jitterless, predictable Signal analog ®digital noiseless, ease of control e.g. CD music • E.g. A={3,4,6,13} ® {3} B ={3,3,6,12} ={3,3,3×21, 3×22} • single-number reduction A (RM) B (PW) 12 0 3 6 9 Pinwheel Transformation 2 /52

  25. Good jitter control in schedules Easy-to-check schedulability Predictable resource accesses Easy extension for aperiodic tasks Predictable end-to-end delay Network scheduling (INFOCOM’95 by Han & Shin) Flexible time-driven approach Pinwheel Scheduling Properties /52

  26. Given a multi-set of distance constraints of n tasks A={a1, a2, ... ,an}, densityr(A) = Si(1/ai ) Find another B={b1, b2, ... ,bn}, "i, bi £ ai, A is schedulable if B is schedulable. If bi’sare multiples (bi|bj) and r(B) £ 1, B is schedulable. E.g. A={3,4,6,7} ®(specialized) B ={3,3,6,6} schedule is “1 23 1 24 1 23 124 ...” The goal is to minimize density increase Pinwheel Scheduler /52

  27. Sa:x=a1, dSa ³ 0.5 Sx:a1/2< x £ a1, dSx ³ 0.65 S23:use 2 and 3, dS23 ³ 7/12 @ 0.58 Sbc: b=a1, b £ c < 2b dSbc ³ 2/3 @ 0.67 CSx CS23 CSa CSbc Previous Works CX: the set of all instances schedulable by Scheduler x dX: the schedulable density bound for Scheduler x

  28. Earlier work:use a base of 2 , find x in (a1/2, a1] Sa, Sx, Sbc, Sby, Sxy: 0.5, 0.65, 2/3, … distance constraints of integer, unit execution time Sr: use a base of 2 , find r in (a1/2, a1] real-numberdistance constraints and execution times Our contributions: Srg:use a base of g Srb:try all bases (optimal for single-number reduction) HSr: near-optimal polynomial-time heuristic Integer Pinwheel Scheduling: Sxg, Sxb , HSx Single-node Pinwheel Scheduling /52

  29. Various Pinwheel Schedulers /52

  30. All nodes are specialized with the same base using DSr (Distributed Sr Scheduling) Pinwheel phase alignment Minimize the total end-to-end delay Minimize the maximum end-to-end delay Nodej N1 N2 Nm ... ... Pinwheelj Pinwheel1 Pinwheel2 Pinwheelm ... Multiple-Node Scheduling /52

  31. a = {(1,2),(1,3)} b = {(1,2.1),(2.1,6)} c = {(1,1.9),(1,4)} d = {(1,2),(2.1,6)} e = {(1,1.9),(2.1,6)} f = {(1,2),(1.1,3)} : Jitterless Relationships of Pinwheel Schedulers CX: the set of all instances schedulable by Scheduler x f. CSrb e. CSx CSr CSxb a. c. d. b. /52

  32. Intranode: pinwheel scheduling makes task executions regular and predictable, i.e. no jitter. Internode: in all nodes, transform the periods of all tasks to harmonic numbers so that tasks of the same period are synchronized. The worst case delay for a task between its arrival and the beginning of its execution on a node is one period. Nodej N1 N2 Nm ... ... Synchronous Scheduling /52

  33. /52

  34. /52

  35. Simplification /52

  36. ntasks are schedulable on a node (using HSr) if the total utilization is £n (21/n- 1). n tasks are schedulable on all nodes (using DSr) if the utilization on any node is £ 21/n-1. Algorithm of O(n log n + nl) to minimize the total or maximum task delay between two nodes with l different periods. Algorithm of O(mn log n + mnl) to minimize the total end-to-end delay on m nodes. Polynomial heuristics to reduce the maximum end-to-end delay on m nodes. Study of Pinwheel Scheduling /52

  37. Off-line construct complete schedule exponential time and space generate effective time parameters start time, resume time, finish time optimization On-line execute tasks according to off-line generated schedule or parameters, inflexible Time-driven Scheduling Approach 6 0 3 /52

  38. Generate start times and finish times in O(n2) task5 SSr: Pinwheel Schedule Constructor 0 5.3 10.6 15.9 21.2 task1 task2 task3 task4 /52

  39. Generate start times and finish times using SSr Next resume time can be found in O(n) the latest finish time of the preempting tasks task4 Time-Driven Pinwheel Scheduling • Generate effective pinwheel schedule. • Use an on-line scheduler to schedule tasks according to the effect schedule. task1 task2 task3 /52

  40. *S:start time, F:finish time, R:resume time; * * amortized TOPS:Time-driven On-line Pinwheel Scheduler /52

  41. Pinwheel Transformation Sr: d ={(1,2),(2.1,6)}®{(1,2),(2.1,4)} overflow Sxb: d ={(1,2),(2.1,6)}®{(1,2),(2.1,6)} 0 2 4 6 8 /52

  42. PX: the set of all periodic task sets schedulable by Scheduler x CX: the set of all DCTS’s schedulable by Scheduler x a = {(1,2),(1,3)} b = {(1,2),(0.5,3),(1,7)} c = {(1,2),(1,3),(1,7)} d = {(1,2),(1.1,3)} e = {(1,2),(2,3)} PEDF e. PRM d. c. CSrb b. a. n £ 2 PRM = CSrb Relationship between CSrb, PRM , and PEDF /52

  43. a = {(1,2),(1,3)} b = {(1,2.1),(2.1,6)} c = {(1,1.9),(1,4)} d = {(1,2),(2.1,6)} e = {(1,1.9),(2.1,6)} f = {(1,2),(1,3),(1,7)} g = {(1,2),(1.1,3)} : Jitterless Relationships of Schedulers CX: the set of all instances schedulable by Scheduler x g. CRM f. CSrb e. CSx CSr CSxb a. c. d. b. /52

  44. a = {(1,2),(1,3)}, r @ 0.83 [Sx] = {(1,2),(1,2)}, F = 1 b = {(1,2.1),(2.1,6)}, r @ 0.83 [Sx] = {(1,2),(2.1,4)}, F @ 1.03 [Sr] = {(1,2.1),(2.1,4.2)}, F @ 0.98 [Sxb] = {(1,2),(2.1,6)} , F = 0.85 c = {(1,1.9),(1,4)}, r @ 0.78 [Sr] = {(1,1.9),(1,3.8)} , F @ 0.79 [Sxb] = {(1,1),(1,4)} , F = 1.25 d = {(1,2),(2.1,6)}, r = 0.85 [Sr] = {(1,1.5),(2.1,6)}, F @ 1.02 [Sxb] = {(1,2),(2.1,6)}, F = 0.85 CRM CSrb CSx a. CSr CSxb d. c. b. Examples of Schedulers

  45. e = {(1,1.9),(2.1,6)}, r @ 0.88 [Sr] ={(1,1.5),(2.1,6)}, F @ 1.02 [Sxb] ={(1,1),(2.1,6)}, F = 1.35 [Srb] ={(1,1.9),(2.1,5.7)}, F @ 0.89 f = {(1,2),(1,3),(1,7)}, r @ 0.97 [Srb] = {(1,2),(1,2),(1,6)}, F @ 1.17 g = {(1,2),(1.1,3)}, r @ 0.87 CSx CSxb CSr CSrb e. f. CRM g. More Examples of Schedulers /52

  46. Comparison of Schedulers *for higher priority tasks /52

  47. Priority Inversion /52

  48. Priority Inheritance /52

  49. m lower priority task access k distinct semaphores A job can be blocked at most min(m,k) critical sections Might have deadlocks Chain of blocking J1 access S1, S2 held by J2, J3 Priority Inheritance (cont.) /52

  50. Inherit the Priority Ceiling of a semaphore Priority Ceiling of a semaphore S The highest priority of the jobs may lock S. Zi,j,k is the kth critical section in Ji guarded by Sj Idea came from: When J1 preempts Z2,1, the priority of J1 will be strictly higher than the priorities of all the preempted critical sections, otherwise J1 is blocked and J2 inherits J1’s priority. A job can be blocked for at most one duration of one critical section.  i, 1 i n, C1/T1+C2/T2+…+Ci/Ti+Bi/Ti  i(21/i-1) Priority Ceiling Protocol /52

More Related