Author: mav
Date: Sat Sep 18 07:18:30 2010
New Revision: 212811
URL: http://svn.freebsd.org/changeset/base/212811

Log:
  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.

Modified:
  head/sys/kern/kern_clocksource.c

Modified: head/sys/kern/kern_clocksource.c
==============================================================================
--- head/sys/kern/kern_clocksource.c    Sat Sep 18 07:16:38 2010        
(r212810)
+++ head/sys/kern/kern_clocksource.c    Sat Sep 18 07:18:30 2010        
(r212811)
@@ -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);
                }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to