mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karl Mehltretter <kmehltretter@gmail.com>
To: Thomas Gleixner <tglx@kernel.org>
Cc: John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
	 Miroslav Lichvar <mlichvar@redhat.com>,
	Jiri Wiesner <jwiesner@suse.de>,
	 Daniel J Blueman <daniel@quora.org>,
	regressions@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] clocksource: delayed watchdog can mark TSC unstable
Date: Thu, 22 Oct 2026 07:43:11 +0200	[thread overview]
Message-ID: <atmhdRzqx5t8PYrc@gmail.com> (raw)
In-Reply-To: <87a4oeerwm.ffs@fw13>

On Thu, Oct 15, 2026 at 08:32:25PM +0100, Thomas Gleixner wrote:
> >   busybox-79 [000] ..s1. 15.168486: clocksource_watchdog <-call_timer_fn
> >   busybox-79 [000] .Ns.. 16.269726: clocksource_watchdog <-call_timer_fn
> >   busybox-79 [000] .Ns.. 16.269820: clocksource_watchdog <-call_timer_fn
> 
> 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.

Thanks,
Karl

      reply	other threads:[~2026-10-22  5:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10  6:55 Karl Mehltretter
2026-10-15 18:32 ` Thomas Gleixner
2026-10-22  5:43   ` Karl Mehltretter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atmhdRzqx5t8PYrc@gmail.com \
    --to=kmehltretter@gmail.com \
    --cc=daniel@quora.org \
    --cc=jstultz@google.com \
    --cc=jwiesner@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=regressions@lists.linux.dev \
    --cc=sboyd@kernel.org \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®