Responsiveness vs. load average (part II)

Marnix Coppens (maco@telindus.be)
Mon, 16 Mar 1998 11:15:24 +0100


[I accidently sent the first message before I had finished it, silly me]
Here's the second part :)

A few remarks are at place here:

1) I have used a function count_delayed_tasks() that skips the process in the
TASK_RUNNING state. You would expect (active_tasks - delayed_tasks) to be
equal (without the FIXED_1 factor) to nr_running, a global variable
maintained
by the scheduler. In practice it turns out be (nr_running + 1). The
difference
is due to the 'cat /proc/loadavg' process I used to measure it
(Heisenberg...),
but I smell a race condition here. To be on the safe side, I just count
them
separately.
2) What happens when a process needs some memory and thereby causes other
processes
to get swapped out? The latter processes will obviously become
TASK_SWAPPING, but what about the first process itself? Logic dictates it
should be marked as TASK_UNINTERRUPTIBLE until the swapping is complete.
I'll
have to look at the source code, I guess...
3) An alternative would be to add some extra fields to the task struct
such that every process would count the number of ticks spent in each
of the various scheduler states (and the total of its children as well, to
accommodate servers that fork a lot). This would be *really* accurate and
probably useful to the people that want to know how well their nntp or http
server is doing. Think of it as a fine-grained version of the stime field.

Cheers,

Marnix Coppens

---
Reality is that which                   | Artificial Intelligence
when you stop believing                 | stands no chance against
in it doesn't go away. (Philip K. Dick) | Natural Stupidity.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu