1 / 55

Radu Dobrin

Combining Off-line Schedule Construction and Fixed Priority Scheduling in Real-Time Computer Systems. Radu Dobrin. Outline . Real-Time Systems Off-line vs. Fixed Priority Scheduling (FPS) Problem Formulation Application Areas Proposed Solution Summary. Real-Time Systems.

silas
Download Presentation

Radu Dobrin

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. Combining Off-line Schedule Construction and Fixed Priority Scheduling in Real-Time Computer Systems Radu Dobrin

  2. Outline • Real-Time Systems • Off-line vs. Fixed Priority Scheduling (FPS) • Problem Formulation • Application Areas • Proposed Solution • Summary

  3. Real-Time Systems Computer systems in which the correctness of the system depends not only on the logical correctness of the computations performed, but also on the time factors (Stankovic et. al.) • Hard • no deadlines may be missed (avionics, nuclear power plants…etc) • Soft • some deadlines may be missed (multimedia applications) • “In between”… • ‘weakly hard RTS’ (Bernat et. al.) • ‘n’ of ‘m’ consecutive deadlines may be missed

  4. Real-Time Systems • Resources • one or several processors • network (if distributed RTS) • … • Tasks • periodic • an infinite sequence of invocations (instances or jobs) • non-periodic • aperiodic, sporadic, etc • Scheduler • makes the decision which task to execute (on which processor) at each point in time based on the scheduling policy

  5. Real-Time Systems Scheduling policy This talk: • off-line (table driven) scheduling • pre-runtime allocation of tasks to processors • priority-driven (on-line) scheduling • fixed priority scheduling (FPS) • dynamic priority scheduling (e.g., EDF) …in hard real-time systems

  6. time 0 4 6 7 8 10 A B run-time dispatcher C D 0 6 7 10 4 8 Off-line (table driven) scheduling • off-line allocation of time-slots to tasks • run-time dispatcher selects task from scheduling tables A B C D

  7. Off-line (table driven) scheduling • off-line allocation of time-slots to tasks • run-time dispatcher selects task from scheduling tables  misc. complex constraints (instance separation, jitter, engineering practice constraints …)  predictability  determinism  inflexible, task executions fixed  need to know all task attributes before run-time

  8. “ready list” run-time dispatcher Fixed Priority Scheduling (FPS) • schedulability test performed off-line – guarantees • on-line servers to handle non-periodic events • scheduling decisions made at run-time A B C D A B D B C

  9. Fixed Priority Scheduling (FPS) • schedulability test performed off-line – guarantees • on-line servers to handle non-periodic events • scheduling decisions made at run-time  widely used (automotive industry, network scheduling - CAN)  flexible  simple run-time mechanism  small run-time overhead  ability to handle complex constraints  additional constraints – new schedulability tests

  10. Proposed solution We want to combine the advantages provided by both: • methods that transform off-line schedulesintoattributes forfixed priority scheduling • execution of fixed priority tasks reenacts original off-line schedule at run-time, if scheduled by FPS

  11. Proposed solution ability to handle complex constraintspredictability Off-line scheduling FPS simple run-time mechanism run-time flexibility FPS

  12. Tasks with complex constraints Off-line scheduler Off-line schedule Constraints fullfiled  FPS system We want: Tasks with FPS attributes Tasks with FPS attributes FPS Tasks with FPS attributes Tasks with FPS attributes Application scenarios Off-line sched. based system We have: Our method FPS schedule

  13. Off-line scheduler Tasks with complex constraints Off-line schedule no priority ordering found? Our method Constraints fullfiled  Tasks with FPS attributes FPS Application scenarios FPS system We have: We want: FPS system FPS schedule

  14. Outline • Real-Time Systems • Off-line vs. Fixed Priority Scheduling (FPS) • Problem Formulation • Application Areas • Proposed Solution • Summary

  15. Off-line to FPS transformation Method to transform off-line schedulesintoattributes forfixed priority scheduling – overview: • Input: off-line schedule and target windows (feasible time intervals for task executions) • derive sequences of task executions from overlapping target windows • derive priority inequalities • solve inequalities by Integer Linear Programming (ILP) • Output: minimum number of FPS tasks and priority levels

  16. est dl A TW(A)=T(A) Off-line to FPS transformation Target Windows: feasible time intervals for task executions under FPS ex: periodic task with simple constraint (dl)

  17. est est est est/dl dl dl dl T(A) T(A) TW(A) TW(A) Off-line to FPS transformation Target Windows: feasible time intervals for task executions under FPS ex: periodic task with an instance separation constraint A A

  18. Off-line schedule TW(A) B A C t TW(B) TW(C) A B C Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) TW(A) TW(B) TW(C)

  19. {current instance}tk Off-line schedule {interfering instance}tk B A C t A tk Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) A TW(A) B B TW(B) C TW(C) SEQk = <BA> =<A > B ordered

  20. {current instance}tk {interfering instance}tk A Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) A TW(A) B B TW(B) C TW(C) tk SEQk = <BA> =<A > B ordered

  21. {current instance}tk+1 {interfering instance}tk+1 A tk+1 Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) A TW(A) B TW(B) C C TW(C) SEQk+1 = <AC> =<C > A ordered

  22. Off-line schedule B A C tk B A SEQk=<B A> Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) • derive priority inequalities to reflect order of execution in the sequences => priority(B)>priority(A)

  23. Off-line schedule A B B A ti tj t SEQi=<A B> SEQj=<B A> Priority(A)>Priority(B) ... Priority(B)>Priority(A) Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) • derive priority inequalities to reflect order of execution in the sequences • problem – inconsistent priorities for instances of same task (not all off-line schedules can be expressed by FPS)

  24. Off-line to FPS transformation • first – task set with original constraints and off-line schedule • split off-line schedule into target windows • derive sequences of instances (each start of TW) • derive priority inequalities to reflect order of execution in the sequences • problem – inconsistent priorities for instances of same task (not all off-line schedules can be expressed by FPS) • solution – modify the problem • treat task instances as new tasks – artifacts • which ones? • potentially many artifacts? useInteger Linear Programmingto • solvepriorityinequalities • minimizenumber of artifacts

  25. ILP formulation Input: - priority inequalities, total nr. of instances Goal function: min G =# fps_tasks = # original_tasks+ (# instances(Ti) - 1)*bi Subject to: … constraints transformed from the priority inequalities 1– create artifacts for Ti’s instancesbi=0 – leave unchanged Output: - bi(which tasks to split) - priorities for fps_tasks

  26. Temporal analysis • transformed FPS tasks execute within derived target windows at run-time • order of execution specified in off-line schedule preservedat run-time, if required by original constraints exact reenaction of off-line schedule by adjusting target windows

  27. Complexconstraints current/interfering instances ILP So far… Off–line schedule Target windows input: instance sequences priority inequalities guaranteed output: FPS tasks

  28. So far… • resolved attribute assignment problem in FPS for multiplecomplex timing constraints • can be used in CAN scheduling • scheduling messages with complex timing requirements • better results than processor scheduling • legacy systems • upgrade/migrate while preserving constraint guarantees • optimization techniques to minimize costs • if an off-line schedule exists, we can transform it to FPS!

  29. So far… FPS • ability to handle complex constraints • predictability  simple run-time mechanism  run-time flexibility √ √ √ ?

  30. Next: handling non periodic events? Usually done by using FPS servers • non-capacity preserving • e.g., background scheduling, polling server • capacity preserving • e.g., deferrable servers, slack stealing • RM based analysis exists • our task model is not RM based! • no optimal server exists • our goal • use servers to provide good service to non-periodic tasks • use/tweak existing ones? • develop new ones? • stillguarantee complex constraints on periodic tasks

  31. Using non-capacity preserving servers Easy – server does not suspend itself • Off-line: • include server in off-line schedule construction • together with complex constrained periodic tasks • derive FPS attributes for both server and periodic tasks • On-line: • if server active and non-periodic request pending • WCET(server)=server capacity • else • BCET(server) = 0

  32. A A TW(A) B TW(B) C C TW(C) tk+1 SEQk+1 = <AC> =<C > A ordered Using capacity preserving servers Difficult – server may execute unpredictable at any time during period • difficult to include in off-line schedule construction • additional interfering instances to the sequences!

  33. A tk+1 Using capacity preserving servers Difficult – server may execute at any time during period • difficult to include in off-line schedule construction • additional interfering instances to the sequences! A TW(A) B S TW(B) C C TW(C) SEQk+1 = <AC> =<C > A ordered

  34. A tk+1 Using capacity preserving servers Solution • take into account potential interference? • pessimistic – over constraining the LP formulation • provide users set of deadlines to prevent undesired interference • assign server highest feasible priority while guaranteeing completion before new deadlines dl(B) A TW(A) S B S TW(B) C C TW(C) SEQk+1 = <AC> =<C > A ordered

  35. Task C T A 2 15 - precedence: A B B 6 15 - execution of A fixed between: (est(A)+2) and (est(A)+4) C 3 10 No fixed priority ordering found? Example constraints (for LCM) + + polling server (S,T=6,C=1)

  36. Task C T A 2 15 - precedence: A B Off-line schedule B 6 15 - execution of A fixed between: (est(A)+2) and (est(A)+4) C 3 10 off-line scheduler A A A A S S S S S C C C B B B B B B C C C B B B B B B C C C 0 30 Example constraints (for LCM) + + polling server (S,T=6,C=1)

  37. Task C T A 2 15 - precedence: A B Off-line schedule B 6 15 - execution of A fixed between: (est(A)+2) and (est(A)+4) C 3 10 off-line scheduler S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Example constraints (for LCM) + + polling server (T=6,C=1)

  38. S current instances C C C Off-line schedule prio(S)>prio(C) SEQ1=<SC> S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C)

  39. A A current instances Off-line schedule prio(A)>prio(C) SEQ2=<ACB> prio(C)>prio(B) S S S S S prio(A)>prio(C) prio(C)>prio(B) B B B B B B A A A A interfering instance C C B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C)

  40. S current instance interfering instance Off-line schedule prio(S)>prio(B) SEQ3=<SB> S S S S S B B B B B B A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B)

  41. current instance interfering instance Off-line schedule prio(B)>prio(C) SEQ3=<BC> C C C S S S S S B B B B B B A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C)

  42. Off-line schedule prio(S)>prio(B) SEQ4=<SBC> prio(B)>prio(C) S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C)

  43. Off-line schedule prio(A)>prio(B) SEQ5=<AB> S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(D) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C) prio(A)>prio(B)

  44. Off-line schedule SEQ6=<ASB> prio(A)>prio(S) prio(S)>prio(B) S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(D) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C) prio(A)>prio(B) prio(A)>prio(S)

  45. Off-line schedule prio(B)>prio(C) SEQ7=<BC> S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C) prio(A)>prio(B) prio(A)>prio(S)

  46. Off-line schedule prio(S)>prio(B) SEQ8=<SBC> prio(B)>prio(C) S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C) prio(A)>prio(B) prio(A)>prio(S)

  47. Off-line schedule prio(C)>prio(B) bc=1: create artifacts for C’s instances priorities: Prio(S) = 4 Prio(A) = 5 (highest) Prio(B) = 2 Prio(C1)= 3 Prio(C2)= 1 Prio(C3)= 1 #fps_tasks=6 prio(B)>prio(C) ILP S S S S S A A A A B B B B B B B B B B B B C C C C C C C C C 0 30 Inequalities prio(S)>prio(C) prio(A)>prio(C) prio(C)>prio(B) prio(S)>prio(B) prio(B)>prio(C) prio(A)>prio(B) prio(A)>prio(S)

  48. Example FPS tasks Off-line scheduled tasks

  49. original constraints • precedence: A B - execution of A fixed between: (est(A)+2) and (est(A)+4) Off-line schedule FPS schedule J1 J2 run-time execution A A A A S S S S S C C C B B B B B B C C C B B B B B B C C C 0 30 Example J1 J2 J2 S (prio 4) A (prio 5) A A B (prio 2) B B B C1 (prio 3) C1 C1 C2 (prio 1) C2 C3 (prio 1) C3

More Related