Re: I/O bound process favoured ???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 13, 2004 at 18:55:23 +0530, Amith wrote:
> hi all,
>         the following paragraph is from "LINUX KERNEL DEVELOPMENT" by Robert Love.
> 
> I/O-Bound Versus Processor-Bound Processes
> Processes can be classified as either I/O-bound or processor-bound. The former is characterized as a process that spends
> much of its time submitting and waiting on I/O requests. Consequently, such a process is often runnable, but only for
> short periods, because it will eventually block waiting on more I/O (this is any type of I/O, such as keyboard activity,
> and not just disk I/O). Conversely, processor-bound processes spend much of their time executing code. They tend to run
> until they are preempted because they do not block on I/O requests very often. Because they are not I/O-driven, however,
> system response does not dictate that the scheduler run them often. The scheduler policy for processor-bound processes,
> therefore, tends to run such processes less frequently but for longer periods. Of course, these classifications are not
> mutually exclusive. The scheduler policy in Unix variants tends to explicitly favor I/O-bound processes.
> 
> i couldnt understand how does the scheduler categorize a process into whether it is an 
> I/O - bound process
> or 
> non - I/O bound process 
> 
> if it ever does in practice ? 
> and thus favor I/O bound processes ?

It does not categorize them. It does not need to.
It's really simple. When a process is running, it's priority is
incremented. When it's waiting to run, it's priority is decremented. The
lowest priority process is scheduled.

So if a process uses up it's CPU time, it enters the ready queue with
high priority and it takes longer before it gets scheduled again.

But if a process does not use it's CPU time, it enters the stopped queue
with relatively low priority and it is decreasing even when the process
is stopped (waiting for data). So when it enters the ready queue, it
get's right to the front and is scheduled.

In fact, it is not favoring I/O bound processes. It is trying to give
fair share of the CPU. If a process does not use it's quantum, it has
right to get more.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux