150 likes | 411 Views
Periodic Task Scheduling. 張軒彬助理教授 中興大學資訊科學系. Outline. Processor Utilization Factor Rate Monotonic Scheduling Earliest Deadline First. Processor Utilization Factor.
E N D
Periodic Task Scheduling 張軒彬助理教授 中興大學資訊科學系
Outline • Processor Utilization Factor • Rate Monotonic Scheduling • Earliest Deadline First
Processor Utilization Factor • Given a set T of n periodic tasks, processor utilization factor U is the fraction of processor time spent in the execution of a task set • There exists a maximum value of U below which T is schedulable and above with T is not schedulable • Depend on the task set and used scheduling algorithm • Let Uub(T, A) denote the upper bound of the processor utilization factor for a task set T under a give algorithm A • If U = Uub(T, A), the set T is said to fully utilize the processor
Processor Utilization Factor (Cont.) • For a given algorithm A, the least upper boundUlub(A) of the processor utilization factor is the minimum of the utilization factors over all task sets that fully utilize the processor Uub1 T1 Uub2 T2 Uub3 T3 Uub4 T4 Uubm Tm U 0 1 Ulub
Processor Utilization Factor (Cont.) • Ulub(A) defines an important characteristics of a real-time scheduling algorithm. • It allow to easily verify the schedulability of a task set. • If a task set whose processor utilization factor is below Ulub(A), then it is schedulable by the algorithm A. • In contrast, if a task set’s processor utilization factor is above Ulub(A), it may or may not be schedulable by the algorithm A
Rate Monotonic Scheduling • Task model: • Periodic tasks • Arbitrary arrival times • Different computation time and deadlines • Preemptive
Rate Monotonic Scheduling (Cont.) • Rate Monotonic (RM) • Assign priorities to tasks according to their request rates • Tasks with higher request rates, i.e., shorter periods, have higher priorities • Fixed-priority scheduling algorithm • Priority are assigned to tasks before execution and do not change over time • Intrinsically preemptive • The currently executing task is preempted by a newly arrived task with shorter period
Rate Monotonic Scheduling (Cont.) • Optimality: RM is optimal among all fixed-priority scheduling algorithms • No other fixed-priority algorithm can schedule a task set that cannot be scheduled by RM • Schedulability condition: given n tasks, the least upper bound of the processor utilization factor under RM is
Rate Monotonic Scheduling (Cont.) • Concluding remarks • The schedulability condition is sufficient to guarantee the feasibility of any task set, but it is not necessary • Thus, if a task set has an utilization factor greater than Ulub and less than one, nothing can be said on the feasibility of the task set
Earliest Deadline First • Earliest Deadline First (EDF) • Selects tasks according to their (absolute) deadlines • Tasks with earlier deadlines will be executed at higher priority • Dynamic scheduling algorithm • The absolute deadline of a periodic task depends on the current ith instances • Thus, EDF is a dynamic priority assignment • Intrinsically preemptive • The current executing task is preempted whenever another periodic instance with earlier deadline become active
Earliest Deadline First (Cont.) • Optimality: • EDF is optimal among all dynamic-priority scheduling algorithms • Schedulability analysis • A set of periodic tasks is schedulable with EDF if and only if
Example • Two tasks: • Task 1: execution time: 2, period: 5 • Task 2: execution time: 4, period: 7 • Processor utilization factor • U = 2/5 + 4/7 = 0.97 • U > Ulcb of RM • RM cannot guarantee schedulability • U < Ulcb(=1) of EDF • EDP thus guarantee schedulability
Example RM T1 0 5 10 15 20 25 30 35 time overflow T2 0 7 14 21 28 35 EDF T1 0 5 10 15 20 25 30 35 T2 0 7 14 21 28 35
Reference • Giorgio C. Buttazzo, “Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications,” Kluwer Academic Publishers, 1997 • Jane W. S. Liu, “Real-Time Systems,” Prentice Hall, 2002