next up previous
Next: Lottery Scheduling Up: How The Linux Scheduler Previous: schedule()

Realtime

  The Linux realtime facilities are very straight forward. Linux doesn't provide hardware support for real time tasks and thus falls in the category of soft real time. Because of the way the goodness (Figure /reffig:goodness.) is computed and because rt_priority doesn't decay, as long as there is at least one realtime task on the run queue, no SCHED_OTHER tasks will run. That is, realtime tasks always beat non-realtime tasks.

Competition among realtime tasks is strictly based upon rt_priority and ordering in the run queue. The task on the run queue with the highest rt_priority is picked to run every time. If there is a rt_priority tie, then the first tying task on the run queue is picked. Scheduling policys of the various tasks factor in when there are multiple tasks with the same rt_priority. A SCHED_FIFO task that wins a rt_priority tie by virtue of being at the front of the run queue will stay at the front of the run queue and continue to win all the ties until it leaves the run queue. On the other hand a SCHED_RR that wins a rt_priority tie will move to the end of the run queue. This move ensures that all other SCHED_RR tasks on the run queue that have the same rt_priority as the current winner will run before the current winner gets to run again.


next up previous
Next: Lottery Scheduling Up: How The Linux Scheduler Previous: schedule()
Brandon Sanders
12/17/1999