git: systimer: Fix statclock() intr% counting for i8254 interrup

看板DFBSD_commit作者時間14年前 (2011/05/17 07:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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
文章代碼(AID): #1DqRGEGE (DFBSD_commit)