1 / 47

Real-Time Scheduling

Real-Time Scheduling. CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi. Real-Time Systems. Systems that must service requests within a precise time constraint:. Air traffic control systems Railway switching systems Industrial automation Robotics Military.

Download Presentation

Real-Time Scheduling

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. Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi

  2. Real-Time Systems Systems that must service requests within a precise time constraint: • Air traffic control systems • Railway switching systems • Industrial automation • Robotics • Military Generally, systems that must respond to external physical phenomena.

  3. Tracking System Example • Dynamic trajectory calculations • False alarms • Verification • System response • Real-time clock • 687m error!

  4. System Resources Different approaches to resource management: • General-purpose OS • Extensible time horizon: all tasks eventually finish • Similarly, elastic memory: demand paging • Fairness • Non-starvation • Real-Time system • Fixed resources • Tasks adjusted accordingly • Predictability

  5. Schedulers • Preemptive / non-preemptive • Static / dynamic • On-line / off-line • Optimal / heuristic • Clairvoyance

  6. Ci t ai si fi di Real-Time Task Parameters Computation time Arrival time start time finish time deadline

  7. Real-Time Tasks Ci Laxity (slack) t ai si fi di Ci Deadline miss x t ai si di fi

  8. RMA • Rate Monotonic Algorithm • Static • Preemptive • Fixed-priority assignment • Periodic tasks • Guarantee-based • Hard real-time correctness – all deadlines always met

  9. RMA (continued) RMA: Assign unique priorities, in descending order, to tasks ordered by ascending periods: the shorter the period, the higher the priority.

  10. RMA – Example Assume deadline equals period (T). A 0 5 10 15 20 25

  11. RMA – Example A B 0 5 10 15 20 25

  12. RMA – Example A B C 0 5 10 15 20 25

  13. RMA – Example A B C 0 5 10 15 20 25

  14. RMA – Example A B C 0 5 10 15 20 25

  15. RMA – Example A B C 0 5 10 15 20 25

  16. RMA – Example A B C 0 5 10 15 20 25

  17. RMA – Example A preempts C A B C 0 5 10 15 20 25

  18. RMA – Example A B C 0 5 10 15 20 25

  19. RMA – Example A B C 0 5 10 15 20 25

  20. RMA – Example A preempts B A B C 0 5 10 15 20 25

  21. RMA – Example C arrives A B C 0 5 10 15 20 25

  22. RMA – Example A B C 0 5 10 15 20 25

  23. RMA – Example A B C 0 5 10 15 20 25

  24. RMA – Example A B C 0 5 10 15 20 25

  25. RMA (continued) • How far can we push this? • Constraints • Number of tasks? • Periods? • Computational times?

  26. Processor Utilization Factor Fraction of CPU time spent in execution of tasks: Otherwise stated: sum of the individual relative load contribution of each task in the task-set. Provides an indication of system-wide computational load.

  27. Feasibility Test RMA guarantee: No deadlines will be missed under rate monotonic scheduling if the following condition holds:

  28. Feasibility Test (continued) • Note that: • That is, any task-set with a CPU utilization factor of 69% or less is schedulable under RMA • Sufficient, but not necessary condition

  29. Optimality RMA is an optimal fixed-priority assignment algorithm: no other fixed-priority algorithms can schedule a task set that cannot be scheduled under RMA.

  30. EDF • Earliest Deadline First • Earlier the deadline, higher the priority. • Dynamic assignment • On-line • No periodicity assumptions – can schedule aperiodic tasks.

  31. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25 Hyper-period

  32. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25

  33. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25

  34. EDF – Example Assume deadline equals period (T). Lexical order tie breaker A B C 0 5 10 15 20 25

  35. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25

  36. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25

  37. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25

  38. EDF – Example Assume deadline equals period (T). A B C 0 5 10 15 20 25 Pattern repeats

  39. EDF Properties • Feasibility test: • U = 100% in example • Bound theoretical • Sufficient and necessary • Optimal

  40. Overload • Hard real-time • No deadlines misses. • Dimension system to meet exact timing requirements. • Soft real-time • May encounter transient or sustained overload. • Design algorithm to achieve desired temporal behavior.

  41. Real-Time Overload Scheduling • Runtime uncertainty • Dynamic system • Aggregate demand exceeds capacity • Fixed available bandwidth • Must shed load • Starvation • Who survives?

  42. EDF Domino Effect Deadline sole scheduling parameter

  43. EDF Domino Effect Cascading deadline misses X X X Deadline sole scheduling parameter

  44. Load Shedding • Feasible schedule if any task excluded in example? • Selection criteria • Fitness metric • Second dimension: utility

  45. Load Shedding Overload detected X X X

  46. Load Shedding Two scheduling parameters: deadline and utility u = 3 Least valuable task u = 1 X u = 5 X u = 7 X

  47. Load Shedding u = 3 Least valuable task u = 1 X u = 5 u = 7

More Related