Next: schedule()
Up: How The Linux Scheduler
Previous: How The Linux Scheduler
During scheduling, the kernel relies upon a linked list of runnable
tasks to determine who should run next. This linked list is a list of
data structures of type task_struct that each contain
information about a particular task. The important elements in the
task_struct from the scheduler's point of view include:
- volatile long state; contains whether this task is runnable, and if not whether it is interruptible (may receive signals) or not.
- long counter; represents the dynamic portion of the
task's goodness . Whenever it is reset, it is set to
priority. At certain points in the task's execution (most
commonly when the 10 msec timer goes off while the task is running)
the counter is decremented. If the counter ever
reaches 0 while the task is executing, need_resched is set.
- long priority; respresents the static
portion of the task's goodness .
- long need_resched; is examined before returning to the current task after a system call and each time the 10 msec timer interrupts. If need_resched is set, schedule() is called.
- unsigned long policy; states whether the current task
is being scheduled under soft realtime first in first out
(SCHED_FIFO ), soft realtime round robin (SCHED_RR ), or the normal
Linux priority scheduling policy (SCHED_OTHER).
- unsigned rt_priority; is used to determine a soft
realtime task's goodness .
- struct mm_struct *mm; points to the memory management
information for the task. Some tasks share a single
mm_struct.
Next: schedule()
Up: How The Linux Scheduler
Previous: How The Linux Scheduler
Brandon Sanders
12/17/1999