periodic task scheduling
play

Periodic Task Scheduling Radek Pel anek Introduction Periodic - PowerPoint PPT Presentation

Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Periodic Task Scheduling Radek Pel anek Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Examples of Periodic


  1. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Periodic Task Scheduling Radek Pel´ anek

  2. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Examples of Periodic Tasks sensory data acquisition control loops action planning system monitoring

  3. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Simplifying Assumptions constant period T i all instances (jobs) of a task have the same computation time C i no precedence relations, no resources preemption (deadline is equal to period D i = T i ) (no aperiodic jobs)

  4. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Example τ 1 τ 2 τ 3 C i 2 4 3 6 10 12 T i find schedule think about possible scheduling algorithms

  5. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Outlook notions: jitter, processor utilization, schedulable utilization three basic approaches: static scheduling, dynamic priorities (EDF), fixed priorities (rate monotonic) examples discussion

  6. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Jitter deviation of the start/finishing time of consecutive instances of some task relative, absolute jitter for some applications it is important to minimize the jitter we do not deal with this issue in detail

  7. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Processor Utilization Factor Processor Utilization Factor Definition (Processor utilization factor) Given a set Γ of n periodic tasks, processor utilization factor U is the fraction of processor time spent in the execution of the task set: C i U = Σ n i =1 T i Example: U = 2 6 + 4 10 + 3 12 = 59 60 Note: U > 1 ⇒ not schedulable

  8. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Processor Utilization Factor Schedulable Utilization Definition (Schedulable Utilization) schedulable utilization U S of a scheduling algorithm – the algorithm can feasibly schedule any set of periodic tasks o with the total utilization of the tasks is ≤ U S used to easily verify the schedulability of a task set

  9. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Cyclic Scheduling an approach, rather than algorithm (timeline scheduling, clock-driven scheduling) static schedule, constructed off-line schedule specifies exactly when each job executes minor cycle = greatest common divisor of periods major cycle = time after which the schedule repeats itself

  10. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Example T A = 25 , T B = 50 , T C = 100

  11. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Aperiodic Jobs spare capacities in the static schedule can be used for handling aperiodic jobs aperiodic jobs can be scheduled e.g. by deadline based algorithm

  12. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Advantages and Disadvantages advantages: simple, efficient (precomputed) can deal with complex requirements, precedence constraints, ... special requirements can be taken into account (e.g., minimizing jitter or context switches) disadvantages: inflexible, difficult to modify and maintain fragile (overrun may cause whole schedule to fail) not very suitable for systems with both periodic and aperiodic tasks Suitable for systems which are rarely modified once built (e.g., small embedded controllers).

  13. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Earliest Deadline First dynamic priority assignment selects tasks according to absolute deadline does not depend on periodicity; can be directly used for periodic+aperiodic tasks

  14. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Schedulability Analysis Schedulable utilization of EDF is 1. Theorem A set of periodic tasks is schedulable with EDF if and only if C i Σ n ≤ 1 i =1 T i

  15. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Extensions deadlines less than periods, aperiodic jobs the algorithm works directly for both extensions schedulability analysis is more complex (not covered)

  16. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Rate Monotonic Scheduling priority based algorithm: tasks scheduled according to priorities fixed-priority assignment: priorities assigned before the execution (all jobs of one task have the same priority) priorities according to periods: shorter period - higher priority preemptive

  17. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Example τ 1 τ 2 τ 3 2 4 3 C i T i 6 10 12

  18. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Optimality in general RM is not optimal RM is optimal among fixed-priority algorithms Theorem If a task set can be scheduled by fixed-priority algorithm then it can be scheduled by Rate Monotonic algorithm.

  19. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Schedulable Utilization For arbitrary set of periodic tasks, the schedulable utilization of the RM scheduling algorithm is U S = n (2 1 / n − 1) n 1 2 3 4 5 1 . 00 0 . 82 0 . 78 0 . 76 0 . 74 U S For high values of n the schedulable utilization converges to U lub = ln 2 ∼ 0 . 69

  20. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Optimality for Simply Periodic Tasks a set of periodic tasks is simply periodic if for every pair of tasks: T i < T j ⇒ T j is an integer multiple of T i Theorem A system of simply periodic tasks is schedulable according to the RM algorithm if and only if its utilization factor is ≤ 1 .

  21. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Deadline Monotonic deadlines less than period priorities assigned according to inverse of relative deadlines

  22. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example τ 1 τ 2 2 4 C i T i 5 7 What is the utilization factor? Is the task set schedulable? What is the schedule produced by EDF/RM?

  23. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example U = 2 5 + 4 7 = 34 35 ∼ 0 . 97

  24. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example 2 τ 1 τ 2 τ 3 C i 2 2 2 6 8 12 T i What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM?

  25. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example 3 τ 1 τ 2 τ 3 1 2 3 C i T i 4 6 8 What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM/EDF?

  26. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Comparison: RM vs EDF RM EDF implementation multi-level prior- heap, O (log n ) ity queue, O (1) processor utilization guarantee only for 0 . 69, full utilization practice 0 . 88 context switches many few guarantee test nontrivial simple predictability good bad in practice: fixed-priority schedulers

  27. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Note on Predictability overload condition (processor utilization factor > 1), which tasks will not meet deadlines? EDF – unpredictable RM – predictable (tasks with the longest period) reminder: Apollo 11 landing processor overload RM algorithm used ⇒ predictable behaviour ⇒ decision possible

  28. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Aperiodic Jobs in Priority-driven Systems real systems – combination of periodic and aperiodic tasks main approaches: fixed priority servers: scheduling of periodic tasks done by fixed priority algorithm (typically RM) dynamic priority servers: scheduling of periodic tasks done by dynamic priority algorithm (typically EDF)

  29. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Assumptions and Remarks periodic tasks scheduled by a fixed priority algorithm (specifically rate monotonic) all periodic tasks start simultaneously at time t = 0, deadline = period arrival times of aperiodic tasks are unknown beforehand preemption goal: meet deadlines of periodic tasks, minimize response time of aperiodic tasks ordering of aperiodic tasks not discussed (done by some aperiodic scheduling algorithm, we will use FIFO)

  30. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Example Periodic jobs: τ 1 τ 2 C i 1 2 4 6 T i Aperiodic jobs: J 1 J 2 J 3 J 4 a i 2 8 12 19 2 1 2 1 C i

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend