Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2012 00:21:06 +0000 (UTC)
From:      Davide Italiano <davide@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r238512 - projects/calloutng/sys/kern
Message-ID:  <201207160021.q6G0L6U6087116@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davide
Date: Mon Jul 16 00:21:05 2012
New Revision: 238512
URL: http://svn.freebsd.org/changeset/base/238512

Log:
  Refactor a comment in kern_clocksource.c to explain the need of an
  apparently duplicate check on event times.

Modified:
  projects/calloutng/sys/kern/kern_clocksource.c

Modified: projects/calloutng/sys/kern/kern_clocksource.c
==============================================================================
--- projects/calloutng/sys/kern/kern_clocksource.c	Mon Jul 16 00:14:25 2012	(r238511)
+++ projects/calloutng/sys/kern/kern_clocksource.c	Mon Jul 16 00:21:05 2012	(r238512)
@@ -871,7 +871,13 @@ cpu_new_callout(int cpu, struct bintime 
 	state = DPCPU_ID_PTR(cpu, timerstate);
 	ET_HW_LOCK(state);
 
-	/* If there is callout time already set earlier -- do nothing. */
+	/* 
+	 * If there is callout time already set earlier -- do nothing. 
+	 * This check may appear redundant because we check already in  
+	 * callout_process() but this double check guarantees we're safe 
+	 * with respect to race conditions between interrupts execution 
+	 * and scheduling. 
+	 */
 	if (state->nextcall.sec != -1 &&
 	    bintime_cmp(&bt, &state->nextcall, >=)) {
 		ET_HW_UNLOCK(state);



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