Re: [REGRESSION] clocksource: delayed watchdog can mark TSC unstable
From: Thomas Gleixner
Date: Sun Oct 25 2026 - 17:49:09 EST
On Thu, Oct 22 2026 at 07:43, Karl Mehltretter wrote:
> On Thu, Oct 15, 2026 at 08:32:25PM +0100, Thomas Gleixner wrote:
>> I did not think about that scenario obvioulsy. The code is resilient
>> against long intervals between two measurements, so the easy and
>> straight forward fix is indeed what you (or the LLM) suggested.
>>
>> Thanks,
>>
>> tglx
>> ---
>> --- a/kernel/time/clocksource.c
>> +++ b/kernel/time/clocksource.c
>> @@ -673,7 +673,7 @@ static void clocksource_watchdog(struct
>>
>> /* Could have been rearmed by a stop/start cycle */
>> if (!timer_pending(&watchdog_timer)) {
>> - watchdog_timer.expires += WATCHDOG_INTERVAL;
>> + watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL;
>> add_timer_local(&watchdog_timer);
>> }
>> }
>
> Yes, I tested this change on v7.3-rc5 (72d3fcf802c4)
>
> baseline patched
> TSC marked unstable 2/3 boots 0/3 boots
> watchdog gaps below 250 ms 3/3 boots 0/3 boots
> minimum traced gap 0.231 ms 505.484 ms
>
> Each boot had four QEMU TCG vCPUs. I used PTRACE_ATTACH to
> stop only the vCPU 0 TCG thread for 800 ms.
Care to send a formal patch? After all you decoded the problem and
suggested the fix. So you should get the credit for it not me.
Thanks,
tglx