[lkml]   [2001]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: scheduler policy
On Thu, Sep 13, 2001 at 09:27:56PM -0500, shreenivasa H V wrote:
> Hi,
> In process scheduling, when an epoch ends because of the current process
> completing its time quantum (and all the runnable ones having finished their
> respective quantums), at the start of the new epoch, will the current running
> process retain the cpu (assuming all the runnable ones are of the same
> priority)?

Short answer, for UP kernels yes.

If all the tasks on the runqueue have the same priority (nice value),
then they will all (almost) have the same goodness value at the start
of the new epoch. However, tasks with the same memory map as the
currently running task will get their goodness value boosted by 1.
The next task to run will be the first one found that has the same
memory map as the currently running task. The check for 'still_running'
ensures that the the currently running task will be found first.

Not sure if this is by design, but this is what the code does.

Also, note that this is only true for UP kernels. In SMP, there
are other factors to consider and a level of unpredictability
due to racing with other CPUs as a result of dropping the runqueue
lock during the 'recalculate' operation.

Mike Kravetz
IBM Linux Technology Center (we're not at Sequent anymore)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.043 / U:4.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site