Re: Linux scheduler and goodness calculation

From: Dimitris Michailidis (dimitris@cthulhu.engr.sgi.com)
Date: Mon Jun 26 2000 - 14:21:52 EST


Tigran Aivazian <tigran@veritas.com> writes:

> Hi guys,
>
> Whilst we (on this cpu) are going through the runqueue and selecting the
> process with the highest goodness, someone else (schedule() running on
> another cpu) could be going through the entire set of processes and
> recalculating their dynamic priorities (p->counter) because schedule drops
> runqueue_lock at recalculate label in schedule(), presumably for
> performance reasons, i.e. to let another schedule() execute as soon as
> possible while we may be spending ages in for_each_task() loop.
>
> Isn't this inconsistent? This means that what is selected as "highest
> goodness" on this cpu is not necessarily the "fair value" because it is
> based on wrong values of p->counter of the tasks examined (i.e. on the
> runqueue).
>
> Any comments?

It is inconsistent but causes no harm. There are several other races in the
scheduler (multiple CPUs recalculating counters at the same time, several
woken up processes choosing the same idle CPU, etc) and there are patches to
fix them.

-- 
Dimitris Michailidis                    dimitris@engr.sgi.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:09 EST