Author: mav
Date: Sun Oct 31 11:44:41 2010
New Revision: 214597
URL: http://svn.freebsd.org/changeset/base/214597

Log:
  Fix callout_tickstofirst() behavior after signed integer ticks overflow.
  This should fix callout precision drop to 1/4s after 25 days of uptime
  with HZ = 1000.
  
  Submitted by: Taku YAMAMOTO <t...@tackymt.homeip.net>

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c        Sun Oct 31 09:21:27 2010        
(r214596)
+++ head/sys/kern/kern_timeout.c        Sun Oct 31 11:44:41 2010        
(r214597)
@@ -295,8 +295,7 @@ callout_tickstofirst(int limit)
                sc = &cc->cc_callwheel[ (curticks+skip) & callwheelmask ];
                /* search scanning ticks */
                TAILQ_FOREACH( c, sc, c_links.tqe ){
-                       if (c && (c->c_time <= curticks + ncallout)
-                           && (c->c_time > 0))
+                       if (c->c_time - curticks <= ncallout)
                                goto out;
                }
                skip++;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to