freebsd-src/sys/conf
Colin Percival c2705ceaeb x86: Speed up clock calibration
Prior to this commit, the TSC and local APIC frequencies were calibrated
at boot time by measuring the clocks before and after a one-second sleep.
This was simple and effective, but had the disadvantage of *requiring a
one-second sleep*.

Rather than making two clock measurements (before and after sleeping) we
now perform many measurements; and rather than simply subtracting the
starting count from the ending count, we calculate a best-fit regression
between the target clock and the reference clock (for which the current
best available timecounter is used). While we do this, we keep track
of an estimate of the uncertainty in the regression slope (aka. the ratio
of clock speeds), and stop measuring when we believe the uncertainty is
less than 1 PPM.

In order to avoid the risk of aliasing resulting from the data-gathering
loop synchronizing with (a multiple of) the frequency of the reference
clock, we add some additional spinning depending upon the iteration number.

For numerical stability and simplicity of implementation, we make use of
floating-point arithmetic for the statistical calculations.

On the author's Dell laptop, this reduces the time spent in calibration
from 2000 ms to 29 ms; on an EC2 c5.xlarge instance, it is reduced from
2000 ms to 2.5 ms.

Reviewed by:	bde (previous version), kib
MFC after:	1 month
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D33802
2022-01-12 12:34:07 -08:00
..
config.mk mips: Remove sys/mips 2021-12-30 20:57:24 -07:00
dtb.build.mk Switch to the new device-tree vendor tree 2021-01-15 20:08:39 +01:00
dtb.mk
files cxgbe(4): Update firmwares to 1.26.6.0. 2022-01-03 15:24:42 -08:00
files.amd64 x86: Speed up clock calibration 2022-01-12 12:34:07 -08:00
files.arm arm: add dwc3 as a compilable driver 2021-12-23 10:36:51 -08:00
files.arm64 Add arm64 pointer authentication support 2022-01-12 15:27:17 +00:00
files.i386 x86: Speed up clock calibration 2022-01-12 12:34:07 -08:00
files.powerpc [PowerPC] PowerMac timebase sync for G4 2021-12-23 16:06:07 -06:00
files.riscv riscv: gdb(4) support 2022-01-10 13:40:12 -04:00
files.x86 pchtherm: Let the driver be compiled into the kernel 2021-11-22 12:12:37 -05:00
kern.mk mips: Remove sys/mips 2021-12-30 20:57:24 -07:00
kern.opts.mk Add clarifying comments 2022-01-02 00:30:58 -07:00
kern.post.mk amd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled 2021-12-07 02:10:48 +02:00
kern.pre.mk mips: Remove sys/mips 2021-12-30 20:57:24 -07:00
kmod.mk Use ${MACHINE} for the kernel modeule ldscript 2022-01-11 16:58:31 +00:00
kmod.opts.mk
kmod_syms.awk kmod_syms.awk: fix removal of the export list from the symbol table 2021-11-18 15:56:24 +02:00
kmod_syms_prefix.awk
ldscript.amd64 amd64: do not assume that kernel is loaded at 2M physical 2021-07-31 16:53:42 +03:00
ldscript.arm
ldscript.arm64 arm64: add read_frequently, read_mostluy and exclusive_cache_line to linker script 2021-08-23 15:22:17 +02:00
ldscript.i386
ldscript.kmod.amd64
ldscript.kmod.i386
ldscript.powerpc
ldscript.powerpc64
ldscript.powerpc64le
ldscript.powerpcspe
ldscript.riscv
Makefile.amd64
Makefile.arm ipq4018: add TCSR definitions from Linux. 2021-10-18 19:18:01 +00:00
Makefile.arm64 arm64: Don't rely on host readelf for u-boot booti image generation 2021-12-24 19:25:20 +00:00
Makefile.i386
Makefile.powerpc
Makefile.riscv riscv: Add the device-tree path to the include path 2021-01-16 11:31:17 +01:00
newvers.sh newvers.sh: better regexp for the FreeBSD_version line 2021-04-22 11:45:12 -06:00
NOTES Remove an obsolete warning from NOTES 2022-01-03 13:00:50 -05:00
options ed: Remove options 2021-12-09 17:41:39 -07:00
options.amd64 linux(4): Get rid of Linuxulator kernel build options. 2021-06-22 08:32:39 +03:00
options.arm arm: allow the debug stuff in CP14 to be disabled at compile time 2021-10-18 19:18:56 +00:00
options.arm64 Per-thread stack canary on arm64 2021-11-26 14:44:00 +00:00
options.i386 Retire synchronous PPP kernel driver sppp(4). 2021-10-22 11:41:36 -07:00
options.powerpc powerpc/pseries: Allow radix pmap in pseries for ISA 3.0 2021-08-11 19:07:04 -05:00
options.riscv
std.nodebug std.nodebug: turn off net80211 debugging as well 2021-11-24 18:06:20 +00:00
sysent.mk sysent: regenerate files every time 2021-12-16 20:56:28 -06:00
systags.sh
vdso_amd64.ldscript amd64: wrap 64bit sigtramp into vdso 2021-12-06 20:46:49 +02:00
vdso_amd64_ia32.ldscript vdso for ia32 on amd64 2021-12-06 20:46:49 +02:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE