systimer: Fix statclock() intr% counting for i8254 interrupt cputimer
If i8254 is used as interrupt cputimer, it will send IPIs to APs to get
statclock() called. In order to detect fast interrupt, statclock()
tests gd_intr_nesting_level to see whether it should bump intr% or not,
however, during IPI processing, gd_intr_nesting_level is bumped up, which
tricks statclock() to believe that intr% should be incremented. This
usually leads to 100% interrupt time on APs reported by utilities like
systat(1). To solve this problem:
- Pass in_ipi to systimer functions to indicate whether the functions are
called during IPI processing or not.
- In statclock(): if it is called during IPI processing, using
(gd_intr_nesting_level - 1) to test whether intr% should be incremented
or not.
Additional cleanup:
- Make systimer_init_*() interface stricter, by using "systimer_func_t"
instead of "void *"
12 files changed: