NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/53648: Serious clock drift when running inside KVM



>Number:         53648
>Category:       port-amd64
>Synopsis:       Serious clock drift when running inside KVM
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 03 17:55:01 +0000 2018
>Originator:     nia
>Release:        NetBSD 8.99.25
>Organization:
>Environment:
System: NetBSD 8.99.25 (GENERIC) #0: Sat Sep 22 05:24:22 UTC 2018  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

With ntpd running:

$ ntpdate -q 0.netbsd.pool.ntp.org
server 193.150.34.2, stratum 2, offset 891.005872, delay 0.03432
server 178.79.152.182, stratum 2, offset 891.000869, delay 0.03198
server 80.87.128.17, stratum 3, offset 891.001166, delay 0.03790
server 194.80.204.184, stratum 1, offset 891.001526, delay 0.04477
 3 Oct 15:11:20 ntpdate[18592]: step time server 194.80.204.184 offset 891.001526 sec

This seems to happen with any timecounter source. Currently, I've got it
set to ACPI-Safe, as advised in this thread:

https://mail-index.netbsd.org/netbsd-users/2018/03/04/msg020504.html

$ sysctl kern.timecounter.
kern.timecounter.choice = TSC(q=-100, f=2394744680 Hz) clockinterrupt(q=0, f=100 Hz) piixpm0(q=1000, f=3579545 Hz) hpet0(q=2000, f=100000000 Hz) ACPI-Safe(q=900, f=3579545 Hz) lapic(q=-100, f=1001659389 Hz) i8254(q=100, f=1193182 Hz) dummy(q=-1000000, f=1000000 Hz)
kern.timecounter.hardware = ACPI-Safe
kern.timecounter.timestepwarnings = 0

The default was hpet0, which clearly didn't work. Lots of
"WARNING: negative runtime; monotonic clock has gone backwards".

Similar issue: https://gnats.netbsd.org/45626 - I don't have noatime on
/var, only log.

>How-To-Repeat:
Set up a Vultr VM. Install NetBSD-current. Use an encrypted /home and start NTP on boot.

Wait for clock drift after a day or so.
>Fix:
Reboot.



Home | Main Index | Thread Index | Old Index