[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
The Schduler scans the list of process in the list of process in the
state, and uses several criteria to choose which process to execute.The
linux scheduler has three different scheduling policies:one for 'normal'
processes, two for 'real time' processes.
Each process has an associated process type, a fixed priority, and a
variable priority.The process types can be:
SCHED_FIFO for an a unalterable 'real time' process.
SCHED_RR for an alterable 'real time' process.
SCHED_OTHER for a 'classical' process.
The scheduler policy depends upon the type of the processes in the'ready'
When a process of the type SCHED_FIFO becomes ready,it is executed
immediatel.The scheduler nominates the process with highest priority and
executes it.This process is normally pre-emptible,that is , it has the
processor resources, and the system will not interrupt its execution except
in three situations:
1.Another process of the type SCHED_FIFO having higher priority becomes
ready,and is then executed,
2.The process becomes suspended while waiting for an event, such as a input
3.The process voluntarily gives up the processor following a call to the
sched_yield.The process the passes the 'ready' state,and other processor
.When a process of the type SCHED_RR becomes ready, it is executed
immediately.Its behavior is thus
similar to SCHED_FIFO, with one exception: when the process is executed, a
time sot is attributed to it.When this time period has elapsed, processes of
the types SCHED_FIFO OR SCHED_RR and having an equal or higher priority to
the current process, may be selected and executed.
Process of the type SCHED_OTHER can only be executed when no 'real time'
processes in the ready state exist. The process to be excutedis then
selected after considering the dynamic priorities.The dynamic priority of
the process is decidedpartly the level specified by the usersystem calls
'nice' and setpriority, and partly by a factor calculated by the
system.Inorder to take of aging activity, the priority of a processes which
take several clock cycles to execute diminishes during execution and it may
become of lower priority than processes which are not executing and whose
priority is not modified.
process->counter=(procee->conuter/Int value)+nice_priority specifed by the
Implementation of scheduler can be read at kernel/sched.c.
> -----Original Message-----
> From: Sambasiva Rao.B [SMTP:samba@xxxxxxxxxxxxxx]
> Sent: Tuesday, April 15, 1997 8:33 PM
> To: linux-india-programmers@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [LIP] Scheduler
> On Tue, 13 Feb 2001 jk76_in@xxxxxxxxx wrote:
> > Hi,
> > Can any one explain how scheduling is done in linux
> Each proceess was given priority(p_priority) based on user
> priority. For every clock cycle, the counter value decremented for the
> current running process. When counter reaches to zero swtch() called. To
> take care of aging, the prority is computed as
> p->counter = (p->counter/2) + p_nice
> The process having max(p->counter) will be scheduled.
> It is more efficint than BSD implementation
> An alpha version of a web based tool to manage
> your subscription with this mailing list is at