summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2016-03-24 05:40:56 +0000
committerdlg <dlg@openbsd.org>2016-03-24 05:40:56 +0000
commit72721952378621d244dfaa0930530e2559b1c9df (patch)
treeccbb1cebdaf944b560fee7d61da282b63ac6a71b /sys/kern/kern_clock.c
parentUnbreak arm and m88k: COPY relocations for weak symbols that are overloaded (diff)
downloadwireguard-openbsd-72721952378621d244dfaa0930530e2559b1c9df.tar.xz
wireguard-openbsd-72721952378621d244dfaa0930530e2559b1c9df.zip
set ticks 15 seconds before its value wraps.
this helps us identify issues around ticks wrap in 15 minutes instead of 240ish days. the change is inspired by something freebsd did as a result of a ticks change they made that went horribly wrong. lots of people said they wanted this
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index c9d596e3769..61ec41af87d 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.89 2016/03/20 07:56:08 uebayasi Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.90 2016/03/24 05:40:56 dlg Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -115,6 +115,8 @@ initclocks(void)
if (softclock_si == NULL)
panic("initclocks: unable to register softclock intr");
+ ticks = INT_MAX - (15 * 60 * hz);
+
/*
* Set divisors to 1 (normal case) and let the machine-specific
* code do its bit.