Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Sep 2010 07:18:30 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212811 - head/sys/kern
Message-ID:  <201009180718.o8I7IUlt055572@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009180718.o8I7IUlt055572>