PERFORCE change 38947 for review
Warner Losh
imp at FreeBSD.org
Tue Sep 30 21:37:35 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38947
Change 38947 by imp at imp_koguchi on 2003/09/30 21:36:37
document the race in the callout api. this one sucks since
if we lose this one we can have a crash.
Affected files ...
.. //depot/doc/strawman-driver.c#8 edit
Differences ...
==== //depot/doc/strawman-driver.c#8 (text+ko) ====
@@ -83,7 +83,7 @@
/* Everybody active here */
if (callout_stop(&sc->stat_ch, hz, fxp_tick, sc) == 0)
- printf("Maybe we just lost a race\n");
+ printf("Maybe we just lost a race\n"); /* race 3 */
/* Network, ISR and devsw active */
bus_teardown_intr(sc->dev, sc->irq, sc->ih);
@@ -116,8 +116,6 @@
/* #1
*
- * We have a race here.
- *
* The test points 'a' and 'b' might lose the race with the set point 'c'.
*
* If 'c' wins the race with either 'a' or 'b', then we're OK. We properly
@@ -137,3 +135,13 @@
* before 'a', that's OK, because sc is guaranteed to be valid for the
* life of the call to ioctl, or any of the devsw functions.
*/
+
+/* #3
+ *
+ * Callout interface is inharently racy. We have no way of knowing
+ * when a callout might be in progress or complete. A return value of
+ * 0 means either the callout has happened, or is happening. However,
+ * we can't tell if the code has finished executing or not. This
+ * means that if the code is executing and we try to unload the page
+ * that is executing, then we've set ourselves up for a crash.
+ */
More information about the p4-releng
mailing list