You are not logged in.
Hello to the arch-linux community !
I have an odd behaviour of my TSC-clocksource & I'd like to ask for
some comments (or possibly a solution) on this situation.
I'm currently running arch linux kernel 5.14.5-arch1-1.
I'm on a thinkpad T14s AMD Gen1, bios version 1.32 (which states in its release notes that
a TSC-cycle issue has been fixed).
When I shutdown the machine using e.g.
shutdown now
and boot it via manual button press
tsc seems to work:
output of
sudo dmesg | grep tsc
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] tsc: Detected 1697.000 MHz processor
[ 0.165957] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x18761557fca, max_idle_ns: 440795262603 ns
[ 0.369635] clocksource: Switched to clocksource tsc-early
[ 1.525978] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x18761557fca, max_idle_ns: 440795262603 ns
[ 1.526054] clocksource: Switched to clocksource tsc
output of
cat /sys/devices/system/clocksource/clocksource0/current_clocksource`:
tsc
however, once I reboot the machine using e.g. `reboot` via cmdline
i get the following behaviour.
sudo dmesg | grep tsc
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] tsc: Detected 1696.656 MHz processor
[ 0.166461] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x1874d03af40, max_idle_ns: 440795221980 ns
[ 0.377550] clocksource: Switched to clocksource tsc-early
[ 1.404575] tsc: Refined TSC clocksource calibration: 1699.686 MHz
[ 1.404596] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x187ffe91441, max_idle_ns: 440795214783 ns
[ 1.404692] clocksource: Switched to clocksource tsc
[ 2.173197] clocksource: timekeeping watchdog on CPU3: Marking clocksource 'tsc' as unstable because the skew is too large:
[ 2.173209] clocksource: 'tsc' cs_nsec: 502589882 cs_now: 470df11ab cs_last: 43df45343 mask: ffffffffffffffff
[ 2.173212] clocksource: 'tsc' is current clocksource.
[ 2.173224] tsc: Marking TSC unstable due to clocksource watchdog
[ 2.173598] TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.
[ 2.174045] clocksource: Checking clocksource tsc synchronization from CPU 10 to CPUs 0,5-6,9,12.
cat /sys/devices/system/clocksource/clocksource0/current_clocksource
hpet
once I shutdown the machine and manually booting it, tsc works again.
A few sidenotes: apparently after rebooting the machine using `reboot` and adding `tsc=nowatchdog` kernel parameter, tsc seems to work on a reboot aswell.
and according to this discussion
-> https://forums.lenovo.com/t5/Other-Linu … 905?page=2
a user described similar behaviour however the other way around (TSC bug arising using a system shutdown)
Moreover can someone explain to me the difference between tsc & hpet as clocksource and why one would be prefered over the other ?
Greetings !
Last edited by darsonis (2021-09-16 21:49:36)
Offline
I have similar warnings after reboot.
2021-11-28T02:29:07+0300 hp kernel: clocksource: timekeeping watchdog on CPU3: Marking clocksource 'tsc' as unstable because the skew is too large:
2021-11-28T02:29:07+0300 hp kernel: clocksource: 'hpet' wd_nsec: 507501092 wd_now: 1baff6a wd_last: 14c1eae mask: ffffffff
2021-11-28T02:29:07+0300 hp kernel: clocksource: 'tsc' cs_nsec: 506649399 cs_now: 329793bc1 cs_last: 2f01b810e mask: ffffffffffffffff
2021-11-28T02:29:07+0300 hp kernel: clocksource: 'tsc' is current clocksource.
2021-11-28T02:29:07+0300 hp kernel: TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.
2021-11-28T02:29:07+0300 hp kernel: clocksource: Checking clocksource tsc synchronization from CPU 8 to CPUs 0,6-7,9-11,15.
Kernel: x86_64 Linux 5.15.5-arch1-1
CPU: AMD Ryzen 7 5800U with Radeon Graphics @ 16x 1.9GHz
Offline
Moreover can someone explain to me the difference between tsc & hpet as clocksource and why one would be prefered over the other ?
When TSC is the clocksource, userspace can use the vDSO instead of syscalling into the kernel to read time (clock_gettime). So TSC is faster.
For more, see:
https://unix.stackexchange.com/question … using-hpet
https://stackoverflow.com/questions/685 … ent-kernel
https://www.brendangregg.com/blog/2021- … -time.html
Offline
I have the same problem as the two prior posters, and it's interesting that:
1. we all have AMD CPUs
2. it seems CPU3 is always the core "at fault", judging by the kernel log samples
Offline
I'm having the same messages as well. Are you any of you also getting this?
mtrr: your CPUs had inconsistent variable MTRR settings
Offline
Currently with a machine not running Arch, but PVE with kernel 6.8.12-4 also on AMD with this error. I have AMD-VTd/IOMMU enabled, suspecting it might be related. Unfortunately not near machine to test.
My CPU is an AMD Ryzen 7 4800U, Zen 2.
[ 31.446308] clocksource: timekeeping watchdog on CPU13: Marking clocksource 'tsc' as unstable because the skew is too large:
[ 31.446337] clocksource: 'hpet' wd_nsec: 496197072 wd_now: 1ab5188e wd_last: 1a48b00f mask: ffffffff
[ 31.446347] clocksource: 'tsc' cs_nsec: 503947429 cs_now: 16edc5a2de cs_last: 16b7ce445e mask: ffffffffffffffff
[ 31.446356] clocksource: Clocksource 'tsc' skewed 7750357 ns (7 ms) over watchdog 'hpet' interval of 496197072 ns (496 ms)
[ 31.446365] clocksource: 'tsc' is current clocksource.
[ 31.446381] tsc: Marking TSC unstable due to clocksource watchdog
[ 31.446413] TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.
[ 31.446417] sched_clock: Marking unstable (31176103657, 270326988)<-(31463205350, -16793056)
[ 31.446781] clocksource: Checking clocksource tsc synchronization from CPU 2 to CPUs 0-1,5,10-11,13,15.
[ 31.446971] clocksource: Switched to clocksource hpet
Offline