Re: new version of time.c

Andrew Derrick Balsa (andrebalsa@altern.org)
Mon, 13 Jul 1998 17:13:18 +0200


Hi Philip,

On Mon, 13 Jul 1998, Philip Gladstone wrote:
>>Hi,
>
>This code suffers from the same problem that all the existing
>do_fast code suffers from -- namely, the assumption that the timer
>interrupt is processed exactly on the 100Hz tick.

You are right. :-)

Even the "top half" of the timer interrupt sometimes doesn't run immediately,
when e.g. a driver has disabled interrupts and is waiting for something to
happen.

>
>The attached patch fixes the problem for 2.0.3x series kernels
>and has been running for a time without problems. It also includes
>a debugging function (do_both_gettimeoffset) that can be used
>to demonstrate the problem.

Looks very good, specially the debugging function.
>
>The trick is to record (using the do_slow mechanism) the time
>when the interrupt is actually taken, and then factor that into
>the calculation.

Excellent, and the cost is not high at all (2 I/O cycles every 10 ms).

Just one microscopic knitpicking, if you allow me: since reading the TSC is
*much* faster than latching the 8253/82C54 CTC, it should come first.

And a question:
What are and why did you do those changes in /kernel/time.c? (I mean, I
understood those in /arch/i386/kernel/time.c)

Cheers,
---------------------
Andrew D. Balsa
andrebalsa@altern.org

-
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.altern.org/andrebalsa/doc/lkml-faq.html