svn commit: r214597 - head/sys/kern

Alexander Motin mav at FreeBSD.org
Sun Oct 31 11:44:42 UTC 2010


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 <taku at 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++;


More information about the svn-src-all mailing list