svn commit: r238512 - projects/calloutng/sys/kern
Davide Italiano
davide at FreeBSD.org
Mon Jul 16 00:21:06 UTC 2012
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);
More information about the svn-src-projects
mailing list