看板 DFBSD_commit 關於我們 聯絡資訊
commit 96d52ac818036eee9591e612e829d78217bd2d3b Author: Sepherosa Ziehau <sephe@dragonflybsd.org> Date: Thu Apr 14 13:10:55 2011 +0800 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 *" Summary of changes: sys/cpu/i386/include/cpu.h | 2 +- sys/cpu/x86_64/include/cpu.h | 2 +- sys/kern/kern_clock.c | 26 ++++++++++++++++++-------- sys/kern/kern_intr.c | 8 +++++--- sys/kern/kern_poll.c | 5 +++-- sys/kern/kern_systimer.c | 13 +++++++------ sys/kern/kern_time.c | 3 ++- sys/net/dummynet/ip_dummynet.c | 5 +++-- sys/net/if_poll.c | 12 +++++++----- sys/platform/pc32/isa/clock.c | 2 +- sys/platform/pc64/isa/clock.c | 2 +- sys/sys/systimer.h | 13 ++++++------- 12 files changed, 55 insertions(+), 38 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/96d52ac818036eee9591e612e829d78217bd2d3b -- DragonFly BSD source repository