Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zScheduling policies: yRMS; yEDF. zScheduling modeling.

Similar presentations


Presentation on theme: "© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zScheduling policies: yRMS; yEDF. zScheduling modeling."— Presentation transcript:

1 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zScheduling policies: yRMS; yEDF. zScheduling modeling assumptions.

2 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Metrics zHow do we evaluate a scheduling policy: yAbility to satisfy all deadlines. yCPU utilization---percentage of time devoted to useful work. yScheduling overhead---time required to make scheduling decision.

3 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Rate monotonic scheduling zRMS (Liu and Layland): widely-used, analyzable scheduling policy. zAnalysis is known as Rate Monotonic Analysis (RMA).

4 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMA model zAll process run on single CPU. zZero context switch time. zNo data dependencies between processes. zProcess execution time is constant. zDeadline is at end of period. zHighest-priority ready process runs.

5 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Process parameters  T i is computation time of process i;  i is period of process i. period  i Pi computation time T i

6 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Rate-monotonic analysis zResponse time: time required to finish process. zCritical instant: scheduling state that gives worst response time. zCritical instant occurs when all higher- priority processes are ready to execute.

7 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Critical instant P4 P3 P2 P1 critical instant P1 P2 P3 interfering processes

8 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMS priorities zOptimal (fixed) priority assignment: yshortest-period process gets highest priority; ypriority inversely proportional to period; ybreak ties arbitrarily. zNo fixed-priority scheme does better.

9 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMS example time 0510 P2 period P1 period P1 P2 P1

10 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMS CPU utilization zUtilization for n processes is   i T i /  i zAs number of tasks approaches infinity, maximum utilization approaches 69%.

11 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMS CPU utilization, cont’d. zRMS cannot use 100% of CPU, even with zero context switch overhead. zMust keep idle cycles available to handle worst-case scenario. zHowever, RMS guarantees all processes will always meet their deadlines.

12 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. RMS implementation zEfficient implementation: yscan processes; ychoose highest-priority active process.

13 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Earliest-deadline-first scheduling zEDF: dynamic priority scheduling scheme. zProcess closest to its deadline has highest priority. zRequires recalculating processes at every timer interrupt.

14 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. EDF analysis zEDF can use 100% of CPU. zBut EDF may fail to miss a deadline.

15 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. EDF implementation zOn each timer interrupt: ycompute time to deadline; ychoose process closest to deadline. zGenerally considered too expensive to use in practice.

16 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Fixing scheduling problems zWhat if your set of processes is unschedulable? yChange deadlines in requirements. yReduce execution times of processes. yGet a faster CPU.

17 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Priority inversion zPriority inversion: low-priority process keeps high-priority process from running. zImproper use of system resources can cause scheduling problems: yLow-priority process grabs I/O device. yHigh-priority device needs I/O device, but can’t get it until low-priority process is done. zCan cause deadlock.

18 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Solving priority inversion zGive priorities to system resources. zHave process inherit the priority of a resource that it requests. yLow-priority process inherits priority of device if higher.

19 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Data dependencies zData dependencies allow us to improve utilization. yRestrict combination of processes that can run simultaneously. zP1 and P2 can’t run simultaneously. P1 P2

20 © 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Context-switching time zNon-zero context switch time can push limits of a tight schedule. zHard to calculate effects---depends on order of context switches.  In practice, OS context switch overhead is small (hundreds of clock cycles) relative to many common task periods (ms –  s).


Download ppt "© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zScheduling policies: yRMS; yEDF. zScheduling modeling."

Similar presentations


Ads by Google