From 8e860de4bf50505ff825ceedc88a176b1531793a Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Sat, 18 Sep 2010 07:18:30 +0000 Subject: [PATCH] When global timer used at SMP system, update nextevent field on BSP before sending IPI to other CPUs. Otherwise, other CPUs will try to honor stale value, programming timer for zero interval. If timer is fast enough, it caused extra interrupt before timer correctly reprogrammed by BSP. --- sys/kern/kern_clocksource.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index e366ef9583d2..eb20a4068503 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -335,15 +335,15 @@ timercb(struct eventtimer *et, void *arg) bcast = 0; if ((et->et_flags & ET_FLAGS_PERCPU) == 0 && smp_started) { CPU_FOREACH(cpu) { - if (curcpu == cpu) - continue; state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); state->now = now; if (bintime_cmp(&now, &state->nextevent, >=)) { state->nextevent.sec++; - state->ipi = 1; - bcast = 1; + if (curcpu != cpu) { + state->ipi = 1; + bcast = 1; + } } ET_HW_UNLOCK(state); }