mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Chaohai Chen <wdhh6@aliyun.com>,
	jstultz@google.com, sboyd@kernel.org, mlichvar@redhat.com,
	linux-kernel@vger.kernel.org
Cc: Chaohai Chen <wdhh6@aliyun.com>
Subject: Re: [PATCH] clocksource: Require consecutive frequency skew samples before demotion
Date: Tue, 29 Sep 2026 21:54:14 +0200	[thread overview]
Message-ID: <87ik3nj0k9.ffs@fw13> (raw)
In-Reply-To: <20260908111017.3277404-1-wdhh6@aliyun.com>

On Tue, Sep 08 2026 at 19:10, Chaohai Chen wrote:
> The clocksource watchdog marks a clocksource unstable as soon as a single
> frequency comparison against the watchdog clocksource exceeds the allowed
> skew:
>
> 	if (abs(wd_delta - cs_delta) < (max_delta >> ppm_shift) + wd_seq)
> 		return true;
> 	watchdog_data.result = WD_FREQ_SKEWED;
>
> While the readout window is already protected against transient
> disturbances (SMIs, NMIs, long IRQs, vCPU preemption) via the
> WATCHDOG_READOUT_MAX_NS check and WATCHDOG_FREQ_RETRIES, the frequency
> skew decision itself has no hysteresis: a single outlier sample is enough
> to demote the clocksource. This demotion is irreversible at runtime -
> the rating is cleared to 0, CLOCK_SOURCE_VALID_FOR_HRES is dropped, and on
> x86 the one-shot tsc_unstable latch prevents any recovery.
>
> A single skew sample can be produced by a transient glitch of the
> watchdog clocksource itself (HPET/PMTMR are not immune to hiccups or
> errata) rather than by an actual defect of the watched clocksource.

Which systems expose such issues in the real world?

> The threshold defaults to 3 and is tunable via the
> clocksource.wd_freq_skew_confirm module parameter (also usable on the
> kernel command line and writable at runtime through
> /sys/module/clocksource/parameters/wd_freq_skew_confirm), clamped to

No. We just got rid of all related knobs and we are not adding new ones
which are never used and not understandable at all.

Thanks,

        tglx

      reply	other threads:[~2026-09-29 19:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 11:10 Chaohai Chen
2026-09-29 19:54 ` Thomas Gleixner [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=87ik3nj0k9.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=sboyd@kernel.org \
    --cc=wdhh6@aliyun.com \
    /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®