Professional Documents
Culture Documents
Linux Scheduling
Linux Scheduling
CS 4510
Scheduling Policy
The
The
Scheduling Policy
Linux
Scheduling Policy
The
Classes of Processes
Interactive
Processes
Includes:
Command
Shells
Text editors
Graphical applications
Classes of Processes
Batch
processes
Search Engines
Scientific Computations
Classes of Processes
Real-time
processes
Includes
Video
Process Preemption
If
The
Time Quantum
Priorities
Static priority
Assigned
Dynamic priority
Applies
Sum of
Base time quantum
Ticks of CPU time left to the process before its
quantum expires
counter
Steps
1. Inserts current in the proper wait queue
2. Changes state to TASK_INTERRUPTIBLE or
TASK_UNINTERRUPTIBLE
3. Invokes schedule( )
4. Goto step 2 unless resource is available
5. Once resource is available, removes current
from wait queue
Invocation
spin_lock_irq(&runqueue_lock)
repeat_schedule:
next = init_tasks[this_cpu];
c = -1000;
list_for_each(tmp, &runqueue_head)
P = list_entry(tmp, struct task_struct, runlist);
int weight = goodness(p, this_cpu, prev->active_mm);
If (weight > c) c = weight, next = p;
& 1<<this_cpu)
& 1<<this_cpu)
) invokes
_schedule_tail()
This function checks whether some
other process has set the
need_resched field of prev while it was
not running. In this case, the whole
schedule function is reexecuted from
the beginning.
Goodness Values
weight
== -1
weight
== 0
weight
>= 1000
p is a real-time process
Goodness Values
The
weight