summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-10-31 11:44:41 +0000
committermav <mav@FreeBSD.org>2010-10-31 11:44:41 +0000
commitf1bdc586812e81a8dc92b036a28f8a29e0ef1914 (patch)
treef587df0e66c96db3d8415f025bfdea7d53af70ee /sys/kern
parentda8e054ad100a876cdf64a28404bdacf3d01531d (diff)
downloadFreeBSD-src-f1bdc586812e81a8dc92b036a28f8a29e0ef1914.zip
FreeBSD-src-f1bdc586812e81a8dc92b036a28f8a29e0ef1914.tar.gz
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@tackymt.homeip.net>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_timeout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 98f55da..f60af40 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -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++;
OpenPOWER on IntegriCloud