summaryrefslogtreecommitdiff
path: root/sys/kern/kern_tc.c
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2019-12-02 21:47:55 +0000
committercheloha <cheloha@cvs.openbsd.org>2019-12-02 21:47:55 +0000
commit189a114a83964a518e0d0df047aba0304f22db8f (patch)
tree80de7ad9f61ab17dced85b1578bc8e3363c1fb8b /sys/kern/kern_tc.c
parent1767e902e2182b45699c4e54774f9a6861e2b0b3 (diff)
Revert "timeout(9): switch to tickless backend"
It appears to have caused major performance regressions all over the network stack. Reported by bluhm@ ok deraadt@
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r--sys/kern/kern_tc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index a911acc8f59..a9b853b0a14 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_tc.c,v 1.52 2019/12/02 02:24:29 cheloha Exp $ */
+/* $OpenBSD: kern_tc.c,v 1.53 2019/12/02 21:47:54 cheloha Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@@ -477,7 +477,6 @@ tc_windup(struct bintime *new_boottime, struct bintime *new_offset,
struct bintime bt;
struct timecounter *active_tc;
struct timehands *th, *tho;
- int64_t counter_adjustment;
u_int64_t scale;
u_int delta, ncount, ogen;
int i;
@@ -595,8 +594,7 @@ tc_windup(struct bintime *new_boottime, struct bintime *new_offset,
*
*/
scale = (u_int64_t)1 << 63;
- counter_adjustment = th->th_counter->tc_freq_adj;
- scale += ((th->th_adjustment + counter_adjustment) / 1024) * 2199;
+ scale += (th->th_adjustment / 1024) * 2199;
scale /= th->th_counter->tc_frequency;
th->th_scale = scale * 2;
@@ -753,7 +751,7 @@ sysctl_tc(int *name, u_int namelen, void *oldp, size_t *oldlenp,
}
/*
- * Skew the timehands according to any adjtime(2) adjustment.
+ * Skew the timehands according to any adjfreq(2)/adjtime(2) adjustments.
*/
void
ntp_update_second(struct timehands *th)
@@ -768,6 +766,7 @@ ntp_update_second(struct timehands *th)
adj = MAX(-5000, th->th_adjtimedelta);
th->th_adjtimedelta -= adj;
th->th_adjustment = (adj * 1000) << 32;
+ th->th_adjustment += th->th_counter->tc_freq_adj;
}
void