Bug 218606 - Restart operation cause TSC unstable
Summary: Restart operation cause TSC unstable
Status: NEW
Alias: None
Product: Timers
Classification: Unclassified
Component: Interval Timers (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: timers_interval-timers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-15 20:41 UTC by sander44
Modified: 2025-02-08 09:22 UTC (History)
2 users (show)

See Also:
Kernel Version: 6.8.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
possible patch (1.13 KB, patch)
2024-08-22 00:41 UTC, Mario Limonciello (AMD)
Details | Diff

Description sander44 2024-03-15 20:41:57 UTC
Hi Kernel Team,

I notice this today, when i restarted my laptop.

TSC clock timer remain unstable.

Kernel: 6.8.0 stable branch

dmesg | grep clocksource
[    0.040122] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 2228124493813128 ns
[    0.106626] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484873504 ns
[    0.113640] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x2f7a6d49d86, max_idle_ns: 440795363309 ns
[    0.281632] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 2227575962736136 ns
[    0.361893] clocksource: Switched to clocksource tsc-early
[    0.370526] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    1.440817] tsc: Refined TSC clocksource calibration: 3293.826 MHz
[    1.440823] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2f7a84671e2, max_idle_ns: 440795331774 ns
[    1.440852] clocksource: Switched to clocksource tsc
[    6.121459] clocksource: timekeeping watchdog on CPU11: Marking clocksource 'tsc' as unstable because the skew is too large:
[    6.121463] clocksource:                       'hpet' wd_nsec: 501775644 wd_now: 524b545 wd_last: 4b714c3 mask: ffffffff
[    6.121466] clocksource:                       'tsc' cs_nsec: 503497209 cs_now: d2656761b cs_last: cc37ccad6 mask: ffffffffffffffff
[    6.121468] clocksource:                       Clocksource 'tsc' skewed 1721565 ns (1 ms) over watchdog 'hpet' interval of 501775644 ns (501 ms)
[    6.121470] clocksource:                       'tsc' is current clocksource.
[    6.121473] tsc: Marking TSC unstable due to clocksource watchdog
[    6.121612] clocksource: Checking clocksource tsc synchronization from CPU 6 to CPUs 0,9-12.
[    6.121664] clocksource: Switched to clocksource hpet



DMI: ASUSTeK COMPUTER INC. ROG Zephyrus G14 GA401QM_GA401QM/GA401QM, BIOS GA401QM.415 08/11/2023
CPU: AMD Ryzen 9 5900HS with Radeon Graphics         Unknown CPU @ 3.3GHz
Comment 1 sander44 2024-03-19 10:41:23 UTC
Thank you for starting rework timer areas.


https://lore.kernel.org/lkml/171011361729.2468526.2426064486971501672.tglx@xen13/
Comment 2 Mario Limonciello (AMD) 2024-08-22 00:41:34 UTC
Created attachment 306767 [details]
possible patch

Can you see if perhaps this patch helps?
Comment 3 sander44 2024-10-19 19:19:15 UTC
Hi Mario,

I tested with your patch.
And I think it's good now.
This patch was used together with the 6.12.0-rc3+ base to verify.
Now my laptop no longer reports this instability.
Thank you.
Comment 4 Mario Limonciello (AMD) 2024-10-19 23:47:05 UTC
Hi,

Can you please share a log with 6.12-rc3 that reproduces issue without that patch and then another that it doesn't reproduce with 6.12-rc3 and just that patch applied?
Comment 5 sander44 2024-10-24 06:31:11 UTC
Hello Mario,

These days I don't have time to try to reproduce this problem. maybe next week I will try to add your patch over the base of -rc4 or -rc5 to check it again.

But if there are other people, they can check it before me.
Comment 6 Mario Limonciello (AMD) 2024-10-24 13:29:34 UTC
Thanks.  The algorithm that has been used for TSC watchdog has changed in recent kernels, so it's very plausible that it's fixed already and the patch does not do anything.
Comment 7 Thomas Weißschuh 2025-02-08 09:22:13 UTC
I am still running into this on v6.13.1 on a Framework 13 AMD. Will try your patch.

Note You need to log in before you can comment on or make changes to this bug.