next up previous
Next: 1.3 How SWAP-sched works? Up: 1 Introduction Previous: 1.1 What is Dependency?

1.2 Why Dependency Matters?

Run X at normal priority (nice 0) and keep the system really busy by running a lot of interactive jobs (with dynamic priority at 115), or simply run some CPU bound tasks at nice -10. Then start a mpeg player with high priority (nice -20). What would you expect? In my machine, the mpeg player runs at poorly 4 frm/s. Why the tasks running dynamic priorities of 115 can have such dramatic impact on the performance of mpeg player running at nice -20? Inter-task Dependency!!!

What happens is the mpeg player often blocks to wait the normal priority X to render the frames. Without knowing such dependency between mpeg player and X, the existing Linux scheduler would select other tasks to run and thus results in poor video playback quality. This problem is generally known as priority inversion. You may want to check out ``what really happened on Mars'' to get a better idea of how serious the priority inversion problem can be.

Certainly, this very problem can be solved by setting the priority of X to nice -10 (like what Redhat etc. does). However, inter-process communication mechanisms like pipe, socket and signal etc. are widely used in modern applications, and thus the inter-process dependencies are everywhere in today's computer systems. It's not possible for a system administrator to find out all the dependencies and set the priorities properly. Obviously, we need a system that can dynamically detects the dependencies among the tasks and take the dependency information into account when scheduling. swap-sched is such a system.


next up previous
Next: 1.3 How SWAP-sched works? Up: 1 Introduction Previous: 1.1 What is Dependency?