Better precision in rusage and virtual itimers?

From: Corey Minyard (minyard@acm.org)
Date: Mon Nov 13 2000 - 19:01:03 EST


I've looked through the scheduling code and searched pretty much
everywhere I could think of and I've found nothing on this, so it's
time to escalate :-).

The measurement of CPU usage and virtual itimers is crude at best.
It's actually possible to set a relatively short virtual itimer (say,
50ms) and have it use almost no CPU before going off. I have actually
had this happen. For larger values and for gross rusage measurements,
this current scheme is probably ok, but for more fine-grained stuff it
is not ok.

Most, if not all, modern CPUs have a high-precision clock that could
easily track CPU usage down to the microsecond level.

My questions are: has anyone done any work on this? If not, and, if I
was willing to do the work, would it be likely to be accepted?

What I would like to do is the following:

 * Add a way to get to a high-precision clock that architectures can
   provide.

 * Modify fields in task_struct to optionally support higher precision.

 * Add some optional code before and after switch_to() to update the
   timer values and rusage values.

 * Add a way for architectures to report when they enter and leave
   system code (for tracking system verses user usage).

All of this, of course, would be optional and the old way would still
be available.

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



This archive was generated by hypermail 2b29 : Wed Nov 15 2000 - 21:00:24 EST