svn commit: r283667 - projects/hps_head/sys/kern
Hans Petter Selasky
hselasky at FreeBSD.org
Thu May 28 20:36:38 UTC 2015
Author: hselasky
Date: Thu May 28 20:36:37 2015
New Revision: 283667
URL: https://svnweb.freebsd.org/changeset/base/283667
Log:
Direct callouts must be executed after cpu_new_callout() is called in
the callout_process() function. Direct callouts can restart themselves
or another callout which also can call cpu_new_callout(). If this
happens from the completion callback the computed "cc_firstevent" will
be wrong.
Modified:
projects/hps_head/sys/kern/kern_timeout.c
Modified: projects/hps_head/sys/kern/kern_timeout.c
==============================================================================
--- projects/hps_head/sys/kern/kern_timeout.c Thu May 28 20:33:28 2015 (r283666)
+++ projects/hps_head/sys/kern/kern_timeout.c Thu May 28 20:36:37 2015 (r283667)
@@ -632,6 +632,10 @@ callout_process(sbintime_t now)
*/
} while (((int)(firstb - lastb)) <= 0);
+ cc->cc_firstevent = last;
+#ifndef NO_EVENTTIMERS
+ cpu_new_callout(curcpu, last, first);
+#endif
/*
* Check for expired direct callouts, if any:
*/
@@ -639,11 +643,6 @@ callout_process(sbintime_t now)
LIST_REMOVE(tmp, c_links.le);
softclock_call_cc(tmp, cc, 1);
}
-
- cc->cc_firstevent = last;
-#ifndef NO_EVENTTIMERS
- cpu_new_callout(curcpu, last, first);
-#endif
#ifdef CALLOUT_PROFILING
callout_update_stats(cc, 1);
#endif
More information about the svn-src-projects
mailing list