summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2021-01-13 16:28:49 +0000
committercheloha <cheloha@openbsd.org>2021-01-13 16:28:49 +0000
commit9589ba9d8c337eade22f8e39fd77554e71d63034 (patch)
treecf5956dd964131c6ed12d36bae1a10cc37391a71
parentPledge the "-C" code path (diff)
downloadwireguard-openbsd-9589ba9d8c337eade22f8e39fd77554e71d63034.tar.xz
wireguard-openbsd-9589ba9d8c337eade22f8e39fd77554e71d63034.zip
kernel, sysctl(8): remove dead variable: tickadj
The global "tickadj" variable is a remnant of the old NTP adjustment code we used in the kernel before the current timecounter subsystem was imported from FreeBSD circa 2004 or 2005. Fifteen years hence it is completely vestigial and we can remove it. We probably should have removed it long ago but I guess it slipped through the cracks. FreeBSD removed it in 2002: https://cgit.freebsd.org/src/commit/?id=e1d970f1811e5e1e9c912c032acdcec6521b2a6d NetBSD and DragonflyBSD can probably remove it, too. We export tickadj via the kern.clockrate sysctl(2), so update sysctl.2 and sysctl(8) accordingly. Hypothetically this change could break someone's sysctl(8) parsing script. I don't think that's very likely. ok mvs@
-rw-r--r--lib/libc/sys/sysctl.29
-rw-r--r--sbin/sysctl/sysctl.c6
-rw-r--r--sys/arch/mips64/mips64/mips64_machdep.c5
-rw-r--r--sys/conf/param.c3
-rw-r--r--sys/kern/kern_clock.c7
-rw-r--r--sys/sys/kernel.h3
-rw-r--r--sys/sys/time.h3
7 files changed, 13 insertions, 23 deletions
diff --git a/lib/libc/sys/sysctl.2 b/lib/libc/sys/sysctl.2
index d430659cde3..f11c226ca39 100644
--- a/lib/libc/sys/sysctl.2
+++ b/lib/libc/sys/sysctl.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.2,v 1.42 2020/12/29 12:28:23 mglocker Exp $
+.\" $OpenBSD: sysctl.2,v 1.43 2021/01/13 16:28:49 cheloha Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: December 29 2020 $
+.Dd $Mdocdate: January 13 2021 $
.Dt SYSCTL 2
.Os
.Sh NAME
@@ -550,9 +550,8 @@ The scheduler exponential decay value.
A
.Vt struct clockinfo
structure is returned.
-This structure contains the clock, statistics clock and profiling clock
-frequencies, the number of micro-seconds per hz tick, and the clock
-skew rate.
+This structure contains the hard clock, statistics clock and profiling clock
+frequencies, and the number of microseconds per hard clock tick.
.It Dv KERN_CONSDEV Pq Va kern.consdev
The console device.
.It Dv KERN_CPTIME Pq Va kern.cp_time
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index b41ed1fb7e1..5e9e562d308 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.254 2020/12/28 18:29:44 mglocker Exp $ */
+/* $OpenBSD: sysctl.c,v 1.255 2021/01/13 16:28:49 cheloha Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -916,8 +916,8 @@ parse(char *string, int flags)
if (!nflag)
(void)printf("%s%s", string, equ);
(void)printf(
- "tick = %d, tickadj = %d, hz = %d, profhz = %d, stathz = %d\n",
- clkp->tick, clkp->tickadj, clkp->hz, clkp->profhz, clkp->stathz);
+ "tick = %d, hz = %d, profhz = %d, stathz = %d\n",
+ clkp->tick, clkp->hz, clkp->profhz, clkp->stathz);
return;
}
if (special & BOOTTIME) {
diff --git a/sys/arch/mips64/mips64/mips64_machdep.c b/sys/arch/mips64/mips64/mips64_machdep.c
index 5b348d9edd7..a8479191d89 100644
--- a/sys/arch/mips64/mips64/mips64_machdep.c
+++ b/sys/arch/mips64/mips64/mips64_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mips64_machdep.c,v 1.33 2020/07/11 15:18:08 visa Exp $ */
+/* $OpenBSD: mips64_machdep.c,v 1.34 2021/01/13 16:28:49 cheloha Exp $ */
/*
* Copyright (c) 2009, 2010, 2012 Miodrag Vallat.
@@ -323,14 +323,13 @@ cp0_calibrate(struct cpu_info *ci)
* Start the real-time and statistics clocks.
*/
void
-cpu_initclocks()
+cpu_initclocks(void)
{
struct cpu_info *ci = curcpu();
profhz = hz;
tick = 1000000 / hz; /* number of micro-seconds between interrupts */
- tickadj = 240000 / (60 * hz); /* can adjust 240ms in 60s */
cp0_calibrate(ci);
diff --git a/sys/conf/param.c b/sys/conf/param.c
index 47d14805ebc..f5ea79cfd21 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.c,v 1.45 2019/09/07 01:23:23 cheloha Exp $ */
+/* $OpenBSD: param.c,v 1.46 2021/01/13 16:28:50 cheloha Exp $ */
/* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */
/*
@@ -75,7 +75,6 @@
int hz = HZ;
int tick = 1000000 / HZ;
int tick_nsec = 1000000000 / HZ;
-int tickadj = 240000 / (60 * HZ); /* can adjust 240ms in 60s */
int utc_offset = 0;
#define NPROCESS (30 + 16 * MAXUSERS)
#define NTEXT (80 + NPROCESS / 8) /* actually the object cache */
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index b6e0ca4f65a..0230bd8fc6b 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.101 2020/01/21 16:16:23 mpi Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.102 2021/01/13 16:28:49 cheloha Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -120,10 +120,6 @@ initclocks(void)
profhz = i;
psratio = profhz / i;
- /* For very large HZ, ensure that division by 0 does not occur later */
- if (tickadj == 0)
- tickadj = 1;
-
inittimecounter();
}
@@ -421,7 +417,6 @@ sysctl_clockrate(char *where, size_t *sizep, void *newp)
*/
memset(&clkinfo, 0, sizeof clkinfo);
clkinfo.tick = tick;
- clkinfo.tickadj = tickadj;
clkinfo.hz = hz;
clkinfo.profhz = profhz;
clkinfo.stathz = stathz ? stathz : hz;
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index f86701ab327..b0a66fdd47c 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: kernel.h,v 1.24 2020/10/15 15:36:31 cheloha Exp $ */
+/* $OpenBSD: kernel.h,v 1.25 2021/01/13 16:28:50 cheloha Exp $ */
/* $NetBSD: kernel.h,v 1.11 1995/03/03 01:24:16 cgd Exp $ */
/*-
@@ -51,7 +51,6 @@ extern int utc_offset; /* seconds east of UTC */
extern int tick; /* usec per tick (1000000 / hz) */
extern int tick_nsec; /* nsec per tick */
-extern int tickadj; /* "standard" clock skew, us./tick */
extern int ticks; /* # of hardclock ticks */
extern int hz; /* system clock's frequency */
extern int stathz; /* statistics clock's frequency */
diff --git a/sys/sys/time.h b/sys/sys/time.h
index 8c1bf04afa1..e5cd4eba727 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.57 2020/10/15 16:31:11 cheloha Exp $ */
+/* $OpenBSD: time.h,v 1.58 2021/01/13 16:28:50 cheloha Exp $ */
/* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */
/*
@@ -157,7 +157,6 @@ struct itimerval {
struct clockinfo {
int hz; /* clock frequency */
int tick; /* micro-seconds per hz tick */
- int tickadj; /* clock skew rate for adjtime() */
int stathz; /* statistics clock frequency */
int profhz; /* profiling clock frequency */
};