2

I'm getting the below weird warning message sometimes when pinging to 8.8.8.8 (Occurrence is very low). Any idea about the root cause?

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=111 time=256 ms
ping: Warning: time of day goes back (-203756us), taking countermeasures
ping: Warning: time of day goes back (-203647us), taking countermeasures
Harikrishnan
  • 1,159
  • 2
  • 14
  • 32

1 Answers1

5

This has happened to me on AMD type processors before, where the clocksource wasn't shared between CPUs (it was set to jiffies for me).

One of the CPU's was a few jiffies ahead of the other causing the time to go backwards when a process moved between CPUs and compared times.

Try setting the clocksource to tsc, hpet or acpi_pm (in that order) as these clocksources tend to be shared between CPUs.

$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
$ echo 'hpet' > /sys/devices/system/clocksource/clocksource0/current_clocksource

Alternatively you might have an aggressive stepping policy for your timesync (shouldn't occur really after you've booted). Provide the output of /etc/ntp.conf or /etc/chrony.conf for more insight.

Matthew Ife
  • 23,357
  • 3
  • 55
  • 72
  • Does *"it was set"* mean *"someone had to knowingly configure that"* or is that something a mainline or distribution kernel might automatically chose under any realistic circumstances? – anx Sep 21 '21 at 11:49
  • 1
    It was many years ago and the clock source `jiffies` was automatically selected by the kernel as the best one (at the time of boot) as the other clock sources are slower to access so aren't as performative -- yet jiffies also came with the quirk that time flowed backwards which was unacceptable for me. – Matthew Ife Sep 21 '21 at 11:57
  • @MatthewIfe The `available_clocksource` is already set to `tsc hpet acpi_pm` – Harikrishnan Sep 22 '21 at 03:41