【正文】
sses currently in the run queue. ? The priority values of different tasks are also considered while doing these calculations ? When a task gets scheduled to the CPU, its wait_runtime value starts decrementing and as this value falls to such a level that other tasks bee the new leftmost task of the redblack tree and the current one gets preempted. This way CFS tries for the ideal situation where wait_runtime is zero! The Debt ? Since only a single task can run at any one time, the other tasks wait. ? During this wait period the other processes build up a debt which is (wait_runtime). ? So once a task gets scheduled, it will catch up its debt by being allowed to use the CPU for that amount of time. Disk Scheduling In Linux ? The default disk scheduler is known as the Linux Elevator ? This algorithm is augmented by two others ? Deadline I/O scheduler ? Anticipatory I/O scheduler Elevator ? Linux keeps one queue that sorts the list of requests by block number. ? Adding a request can be handled in one of four ways: ? if the new request is on the same sector or an adjacent sector then the two requests are merged ? If a preexisting request is really old then the new request is placed behind the old request ? If there is a suitable location then the request is just placed into that location ? Else the request is just placed at the tail end Deadline Scheduler ? This algorithm acpanies the Elevator algorithm. ? Meant to prevent starvation effect. ? Uses three queues ? The elevator queue ? Read FIFO queue ? Write FIFO queue ? When the time in one of the queues gets older t