j all tasks are periodic u p relative deadline period t s
play

j All tasks are periodic. U = p Relative deadline = period - PDF document

Optimality Optimal Scheduling Algorithms A scheduling algorithm S is optimal if Rate Monotonic Scheduling (RMS) priority = rate = 1/period a system is not schedulable under S optimal preemptive fixed-priority scheduling it


  1. Optimality Optimal Scheduling Algorithms A scheduling algorithm S is optimal if • Rate Monotonic Scheduling (RMS) • priority = rate = 1/period • a system is not schedulable under S � • optimal preemptive fixed-priority scheduling it is not schedulable under any other algorithm scheduling algorithms in the same • Earliest Deadline First (EDF) category • priority = absolute deadline • optimal preemptive dynamic-priority scheduling algorithm Chenyang Lu CSE 467S 1 Chenyang Lu CSE 467S 2 Basic RMS/EDF Analysis Schedulable Utilization Bound Assumptions • Optimality and analysis under assumptions: • CPU utilization of a processor: • Single processor. c ∑ j • All tasks are periodic. U = p • Relative deadline = period T ∈ S j j • No blocking (e.g., to prevent race conditions) where S is the set of all tasks • Zero context switch time. • Schedulable utilization bound U b : All tasks • Both RMS and EDF have been extended to are guaranteed to be schedulable if U ≤ U b relax assumptions Chenyang Lu CSE 467S 3 Chenyang Lu CSE 467S 4 Necessary Condition RMS Utilization Bound • The schedulable utilization bound of RMS for • No scheduling algorithms can guarantee n processes is: U b (n) = n(2 1/n -1) schedulability if U > 1 • U b (2) = 0.828 • U b ≤ 1 • U b (3) = 0.780 • An algorithm must be optimal if its U b = 1 • U b (n) ≥ U b ( ∞ ) = ln2 = 0.693 • U(i) ≤ U b is a sufficient condition, but not necessary in general. • U b = 1 if all process periods are harmonic, i.e., periods are multiples of each other • E.g., 2,4,8,16 Chenyang Lu CSE 467S 5 Chenyang Lu CSE 467S 6

  2. Response Time Analysis for Fixed-Priority Sched Response Time Analysis /* Tasks are ordered by priority; T 1 has the highest priority */ • Assume fixed-priority scheduling for (each task T j ) { • Critical instant: scheduling state that I = 0; do { gives worst response time. R = I + c j ; • Occurs when all higher-priority processes if ( R > d j ) return (UNSCHEDULABLE) are ready to execute. ⎡ ⎤ I ∑ R j 1 − ⎢ ⎥ c ; = k k = 1 ⎢ ⎥ p k } while ( I + c i > R ) return (SCHEDULABLE) } Chenyang Lu CSE 467S 7 Chenyang Lu CSE 467S 8 RMS EDF Utilization Bound • Schedulable utilization bound of EDF: • RMS may not guarantee schedulability U b = 1 even when CPU is not fully utilized • U ≤ U b is sufficient and necessary for • Low overhead: When tasks are known a schedulability. priori , priorities are never changed Chenyang Lu CSE 467S 9 Chenyang Lu CSE 467S 10 EDF Assumptions of RMS and EDF • EDF can guarantee schedulability as • Optimality and analysis under assumptions: long as CPU is not fully utilized • Single processor. • All tasks are periodic. • Higher overhead than RMS: Task • Relative deadline = period priorities may need to be changed online • No blocking (e.g., to prevent race conditions) • Zero context switch time. • What if Deadline < Period? Chenyang Lu CSE 467S 11 Chenyang Lu CSE 467S 12

  3. Optimal Fixed-Priority Algorithm • Deadline Monotonic Scheduling (DMS) • priority = (relative) deadline • optimal fixed priority scheduling when deadline ≤ period • RMS response time analysis also applies to DMS • but priority ordering may not be the same! Chenyang Lu CSE 467S 13

Recommend


More recommend