Re: [Re: scheduler policy]
george anzinger (george@mvista.com)
Fri, 14 Sep 2001 00:44:02 -0700
shreenivasa H V wrote:
>
> thanks, and I have a related question. Consider we have only 2 processes with
> equal priority. Now one of them is switched out for an i/o operation. The
> second one gains the cpu and executes past its time quantum. Since the other
> process is not yet ready this process continues to enjoy the cpu. Now will
> this usage be accounted for a new time quantum for this second process or will
> it be unaccounted. According to what I understand, the second process will not
> start its new time quantum until the epoch has ended i.e., the first one also
> has finished its time quantum. So does this mean the epoch will never end
> until there is a process in the system who's time quantum is yet to be
> expired?
>
Your question is a little confused so I will just say what happens. The
epoch (as you call it) ends when all run able tasks in the run list have
zero quantum. At this time the quanta of all tasks ON THE SYSTEM are
adjusted by keeping 1/2 of what they have and adding a new value that
depends on the NICE value of the task. Thus the task waiting for I/O
will surly have a higher quantum than the running task and when it is
unblocked, will get the cpu at the first context switch opportunity (at
interrupt completion if the running task is in user land, at completion
of the system call if in the system).
(A task can be on the run list and not run able in and SMP system if it
is locked to another cpu. Such a tasks quantum will not be examined to
determine the end of the epoch.)
George
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/