mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Connor Williamson <connordw@amazon.com>
To: <jstultz@google.com>, <tglx@kernel.org>, <sboyd@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <nh-open-source@amazon.com>,
	<paulmck@kernel.org>, <connordw@amazon.com>
Subject: [PATCH timers/core v1] clocksource: Align clocksource watchdog constraints with Kconfig value
Date: Fri, 13 Mar 2026 14:29:28 +0000	[thread overview]
Message-ID: <20260313142939.3023-1-connordw@amazon.com> (raw)

A previous patch intended to update both MAX_SKEW_USEC and
CLOCKSOURCE_WATCHDOG_MAX_SKEW_US to 125 microseconds, resulting in a
total tolerable skew per second of 500 microseconds as this value is
doubled prior to being associated with the uncertainty_margin of a
clocksource, and the uncertainty_margin values of two clocksources being
compared are then summed before comparison to the skew.

However, the default value of MAX_SKEW_USEC in the absence of the
Kconfig option was defined as (125 * WATCHDOG_INTERVAL / HZ), which is
(125 * (HZ >> 1)) / HZ, effectively ~ 125/2 microseconds, while
CLOCKSOURCE_WATCHDOG_MAX_SKEW_US was set to 125 microseconds as
intended.

Therefore, align MAX_SKEW_USEC with CLOCKSOURCE_WATCHDOG_MAX_SKEW_US,
setting it to the intended default value of 125 microseconds.

'Fixes: c37e85c135ce ("clocksource: Loosen clocksource watchdog
constraints")'

Signed-off-by: Connor Williamson <connordw@amazon.com>
---
 kernel/time/clocksource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index e753a0632ac8..bd4aea8db2de 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -137,7 +137,7 @@ static u64 suspend_start;
 #ifdef CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
 #define MAX_SKEW_USEC	CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
 #else
-#define MAX_SKEW_USEC	(125 * WATCHDOG_INTERVAL / HZ)
+#define MAX_SKEW_USEC	125
 #endif
 
 /*
-- 
2.47.3


             reply	other threads:[~2026-03-13 14:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 14:29 Connor Williamson [this message]
2026-03-20 16:58 ` Thomas Gleixner
2026-03-23 13:28   ` connordw
2026-03-23 19:59     ` Thomas Gleixner

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=20260313142939.3023-1-connordw@amazon.com \
    --to=connordw@amazon.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=paulmck@kernel.org \
    --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®