imc4 2rt
play

IMC4-2RT Real-time scheduling Damien MASSON - PowerPoint PPT Presentation

IMC4-2RT Real-time scheduling Damien MASSON http://esiee.fr/~massond/Teaching/ last modification: December 1, 2014 References Hard real-time computing systems: predictable scheduling algorithms and applications, Giorgio C. Buttazzo, Springer,


  1. IMC4-2RT Real-time scheduling Damien MASSON http://esiee.fr/~massond/Teaching/ last modification: December 1, 2014

  2. References Hard real-time computing systems: predictable scheduling algorithms and applications, Giorgio C. Buttazzo, Springer, 2005 - 425 pages ( http://books.google.com/books/about/Hard_real_ time_computing_systems.html?id=fpJAZM6FK2sC ) Internet 2/56

  3. Concurrency Operating systems are mutlitasks, even on monoprocessors architectures. How is it possible ? with processes ! 3/56

  4. Real-Time Real-Time: different from quick, more synonymous to deterministic 4/56

  5. Real-Time Several kind of real-time systems: RTS with strict constraints (hard real-time systems): deadline miss equal human life lost / mission failure (avionic industry) RTS with relative constraints(soft real-time systems): deadline misses are tolerated (multimedia) RTS with mixed constraints 4/56

  6. Real-Time Several kind of real-time systems: RTS with strict constraints (hard real-time systems): deadline miss equal human life lost / mission failure (avionic industry) RTS with relative constraints(soft real-time systems): deadline misses are tolerated (multimedia) RTS with mixed constraints Example Standard DO-178B developed for the avionic industry in USA distinguish 5 criticality levels, e.g: Safety Critical: failure = human lost (e.g. engines control, automatic pilot) Mission Critical: navigation systems, ... 4/56

  7. Scheduling Scheduling algorithm: the algorithm used to decide which task is executed when Schedule: the result of the scheduling algorithm (a sequence of task) Scheduler: the task responsible to apply the scheduling algorithm to produce the schedule two families: preemptive, non preemptive two methodologies: offline / online 5/56

  8. Scheduling Scheduling algorithm: the algorithm used to decide which task is executed when Schedule: the result of the scheduling algorithm (a sequence of task) Scheduler: the task responsible to apply the scheduling algorithm to produce the schedule two families: preemptive, non preemptive two methodologies: offline / online In this class, we will study online preemptive algorithms 5/56

  9. Periodic Model Real-Time: ensure constraints respect. Which constraints ? The most studied model (from the control command field): periodic task systems A periodic task τ i is defined by: its first release time instant: r i its worst case execution time (WCET): C i its period: T i its relative deadline: D i from which we can deduce the absolute deadline of its instance k : d i , k the logic is: upper cases for durations, lower cases for instants ... (extensible model !) 6/56

  10. Example C i T i D i 3 6 6 τ 1 3 12 6 τ 2 3 12 12 τ 3 Round Robin 1 3 1 2 3 2 τ 1 1 2 3 τ 2 3 1 2 τ 3 0 5 10 7/56

  11. Example C i T i D i 3 6 6 τ 1 3 12 6 τ 2 3 12 12 τ 3 fixed priorities Round Robin 1 3 1 2 3 2 1 1 2 3 2 3 τ 1 τ 1 1 2 3 1 3 2 τ 2 τ 2 3 1 2 1 2 3 τ 3 τ 3 0 5 10 0 5 10 7/56

  12. Online preemptive real-time scheduling (Mono Processor) Tasks instances (job) are sorted by priorities. At each time instant, the scheduler gives CPU to the task with the highest priority. fixed priority: tasks priority are fixed once and for all (according to a constant like period, deadline, importance... or arbitrarily), dynamic priority: priorities can change, they are given according to a variable like the next deadline proximity, the system laxity... Evaluating a scheduling algorithm ?? 8/56

  13. Online preemptive real-time scheduling (Mono Processor) Tasks instances (job) are sorted by priorities. At each time instant, the scheduler gives CPU to the task with the highest priority. fixed priority: tasks priority are fixed once and for all (according to a constant like period, deadline, importance... or arbitrarily), dynamic priority: priorities can change, they are given according to a variable like the next deadline proximity, the system laxity... Evaluating a scheduling algorithm ?? optimality schedulability bound easy or not to implement ? execution overhead jitter, stability, average response times... 8/56

  14. Main algorithms Rate Monotonic (RM): priority to the task with the smallest period Deadline Monotonic (DM) : priority to the task with the smallest relative deadline EDF : priority to the most urgent JOB (not task) LLF : priority to the task with the smallest laxity (variable function of time) 9/56

  15. Main algorithms Rate Monotonic (RM): priority to the task with the smallest period Deadline Monotonic (DM) : priority to the task with the smallest relative deadline EDF : priority to the most urgent JOB (not task) LLF : priority to the task with the smallest laxity (variable function of time) Laxity L i ( t ) = D i ( t ) − C ∗ i ( t ) L i ( t ) D i ( t ) 6 11 6 10 9 5 4 8 4 7 9/56 4 6

  16. Exercises Give the schedules obtain with these 4 algorithms between t = 0 et t = 30 for taskset: r i T i D i C i 0 6 6 2 τ 1 0 7 4 3 τ 2 0 15 15 3 τ 3 10/56

  17. RM �� �� ��� ��� �� �� ��� ��� �� �� �� �� τ 1 ���� ���� ��� ��� ���� ���� ��� ��� �� �� τ 2 �� �� � � � � � � � � � � � � ��� ��� �� �� � � � � � � � � � � � � ��� ��� τ 3 0 5 10 15 20 25 30 11/56

  18. DM �� �� �� �� �� �� �� �� ��� ��� �� �� τ 1 ��� ��� ��� ��� ���� ���� ��� ��� ��� ��� τ 2 �� �� � � � � � � � � � � ��� ��� �� �� � � � � � � � � � � ��� ��� τ 3 0 5 10 15 20 25 30 12/56

  19. EDF �� �� �� �� �� �� ��� ��� ��� ��� ��� ��� τ 1 ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� τ 2 �� �� �� �� � � �� �� �� �� �� �� � � �� �� τ 3 0 5 10 15 20 25 30 13/56

  20. LLF �� �� �� �� �� �� �� �� ��� ��� � � �� �� τ 1 ��� ��� ��� ��� ���� ���� ��� ��� ��� ��� τ 2 �� �� �� �� � � �� �� �� �� �� �� � � �� �� τ 3 0 5 10 15 20 25 30 14/56

  21. Schedulability (validity) � = Feasibility Feasibility: given a taskset, is it possible to propose a schedule that respect all timing constraints? Schedulability: given a taskset, is it possible to propose a deterministic algorithm that generates a valid schedule? Schedulability with A: given a taskset and an algorithm A, is A produces a valid schedule? Several approaches depending on the studied problem and the system criticality: sufficient condition for an admission control scheme, fault and/or overload detection, exact analysis with feasibility/schedulability analysis theory. 15/56

  22. System Load study n C i � Processor load: U = T i i =1 This can be enough to conclude under certain assumptions: 1 n − 1) is sufficient (but not necessary) condition for U ≤ n (2 the schedulability iff ∀ i D i = T i (implicit deadlines) with a fixed priority algorithm, U ≤ 1 is a necessary and sufficient condition for the schedulability under EDF iff ∀ i D i = T i , ... But if D i ≤ T i (constrained deadlines), or when D i not related to T i (general case) things are not so simple... 16/56

  23. Schedulability study when D i = T i (fixed priority) 1 n − 1) is a sufficient condition and U ≤ 1 is a U ≤ n (2 necessary condition 1 n − 1) ? when 1 ≤ U > n (2 workload study: we are looking for a time instant before the deadline where all the cumulated demand is satisfied worst case response time computation job j response time R j i : time between the request and the end of the job task worst case response time ( WCRT i ): maximum amongst the R j i for all j 17/56

  24. Demand study If ∀ i , D i ≤ T i , the system is schedulable with a fixed priority algorithm iff it exists a time instant t in the interval (0 , Di ] such that t = w i ( t ) � t � � with w i ( t ) = C k T k k ≤ i recursive algorithm: computation of t 1 = w i (0), then t 2 = w i ( t 1 ), ..., t n = w i ( t n − 1 ) the algorithms ends either when the deadline is reached or if a t with t = w i ( t ) is found. 18/56

  25. Demand study If ∀ i , D i ≤ T i , the system is schedulable with a fixed priority algorithm iff it exists a time instant t in the interval (0 , Di ] such that t = w i ( t ) � t � � with w i ( t ) = C k T k k ≤ i recursive algorithm: computation of t 1 = w i (0), then t 2 = w i ( t 1 ), ..., t n = w i ( t n − 1 ) the algorithms ends either when the deadline is reached or if a t with t = w i ( t ) is found. Exercises study the level 2 demand on the preceding example with RM study the level 2 demand on the preceding example with DM study the level 3 demand on the preceding example with RM is the level 3 demand with DM different ? 18/56

Recommend


More recommend