Re: Time spent on interrupt handling

Craig Schlenter (
Thu, 4 Apr 1996 12:30:39 +0200 (GMT+0200)

> Would it even be possible to add this kind of acocunting into the kernel?

These are just my potentially wrong ideas on the matter as I am a long way
from a kernel guru ... I would be interested in hearing of any info you
get wrt. this issue especially if any of it disputes any of this stuff.

The current timer interrupt is set at 1000Hz (?) and increments the
jiffies counter. While pentium hardware allows access to a finer
resolution internal clock, I don't think this is possible on 386/486
machines. This means that you are restricted to a 1ms resolution for
measuring time spent in interrupts. Actually since this timer itself is
generated from an interrupt, whether it is incremented or not during say
the tulip interrupt handler will depend on whether the tulip handler
re-enables interrupts on entry. The timer interrupt would then pre-empt
the tulip driver interrupt and increment the jiffies count. A
jiffies_at_end_of_tulip_interrupt_handler -
jiffies_at_start_of_tulip_handler should give you the info you need.

Of course you can't use this method to figure out how much time you spend
in the timer interrupt itself or any interrupt routines that do not allow
the timer interrupt to pre-empt them. Using the on-chip (undocumented?)
pentium timers though should relax all of these restrictions ...

Comments from the gurus?