archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <>
Cc:,,,,,,,,, "Paul E. McKenney" <>,
	Chris Mason <>
Subject: [PATCH v9 clocksource 6/6] clocksource: Reduce WATCHDOG_THRESHOLD
Date: Sun, 18 Apr 2021 21:53:00 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20210419045155.GA596058@paulmck-ThinkPad-P17-Gen-1>

Currently, WATCHDOG_THRESHOLD is set to detect a 62.5-millisecond skew in
a 500-millisecond WATCHDOG_INTERVAL.  This requires that clocks be skewed
by more than 12.5% in order to be marked unstable.  Except that a clock
that is skewed by that much is probably destroying unsuspecting software
right and left.  And given that there are now checks for false-positive
skews due to delays between reading the two clocks, and given that current
hardware clocks all increment well in excess of 1MHz, it should be possible
to greatly decrease WATCHDOG_THRESHOLD.

Therefore, decrease WATCHDOG_THRESHOLD from the current 62.5 milliseconds
down to 200 microseconds.

Suggested-by: Thomas Gleixner <>
Cc: John Stultz <>
Cc: Stephen Boyd <>
Cc: Jonathan Corbet <>
Cc: Mark Rutland <>
Cc: Marc Zyngier <>
Cc: Andi Kleen <>
[ paulmck: Apply Rik van Riel feedback. ]
Reported-by: Chris Mason <>
Signed-off-by: Paul E. McKenney <>
 kernel/time/clocksource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 2981e293a468..d82ad0492777 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -125,14 +125,14 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating);
  * Interval: 0.5sec Threshold: 0.0625s
 #define WATCHDOG_INTERVAL (HZ >> 1)
  * Maximum permissible delay between two readouts of the watchdog
  * clocksource surrounding a read of the clocksource being validated.
  * This delay could be due to SMIs, NMIs, or to VCPU preemptions.
 static void clocksource_watchdog_work(struct work_struct *work)

  parent reply	other threads:[~2021-04-19  4:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  4:51 [PATCH v9 clocksource 0/6] Do not mark clocks unstable due to delays for v5.13 Paul E. McKenney
2021-04-19  4:52 ` [PATCH v9 clocksource 1/6] clocksource: Provide module parameters to inject delays in watchdog Paul E. McKenney
2021-04-19  4:52 ` [PATCH v9 clocksource 2/6] clocksource: Retry clock read if long delays detected Paul E. McKenney
2021-04-19  4:52 ` [PATCH v9 clocksource 3/6] clocksource: Check per-CPU clock synchronization when marked unstable Paul E. McKenney
2021-04-19  4:52 ` [PATCH v9 clocksource 4/6] clocksource: Provide a module parameter to fuzz per-CPU clock checking Paul E. McKenney
2021-04-19  4:52 ` [PATCH v9 clocksource 5/6] clocksource: Limit number of CPUs checked for clock synchronization Paul E. McKenney
2021-04-19  4:53 ` Paul E. McKenney [this message]
2021-04-25 22:45 [PATCH v10 clocksource 0/7] Do not mark clocks unstable due to delays for v5.13 Paul E. McKenney
2021-04-25 22:47 ` [PATCH v9 clocksource 6/6] clocksource: Reduce WATCHDOG_THRESHOLD Paul E. McKenney

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v9 clocksource 6/6] clocksource: Reduce WATCHDOG_THRESHOLD' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).