diff options
author | phk <phk@FreeBSD.org> | 2002-09-04 10:15:19 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-04 10:15:19 +0000 |
commit | 8ceeefb3da4a98a7b2631b976210c60828fecf56 (patch) | |
tree | 1686e2061db64b4267c1e8e3c03c6a9dfadd5aee /sys/kern/kern_tc.c | |
parent | f230fa27fb7dfbf8aa6fc49c6b846e56a35aada0 (diff) | |
download | FreeBSD-src-8ceeefb3da4a98a7b2631b976210c60828fecf56.zip FreeBSD-src-8ceeefb3da4a98a7b2631b976210c60828fecf56.tar.gz |
Give up on calling tc_ticktock() from a timeout, we have timeout
functions which run for several milliseconds at a time and getting
in queue behind one or more of those makes us miss our rewind.
Instead call it from hardclock() like we used to do, but retain the
prescaler so we still cope with high HZ values.
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r-- | sys/kern/kern_tc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index e2607bf..d3d437d 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -647,12 +647,15 @@ pps_event(struct pps_state *pps, int event) static int tc_tick; SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tick, 0, ""); -static void -tc_ticktock(void *dummy) +void +tc_ticktock(void) { + static int count; + if (++count < tc_tick) + return; + count = 0; tc_windup(); - timeout(tc_ticktock, NULL, tc_tick); } static void @@ -678,7 +681,6 @@ inittimecounter(void *dummy) /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); - tc_ticktock(NULL); } SYSINIT(timecounter, SI_SUB_CLOCKS, SI_ORDER_FIRST, inittimecounter, NULL) |