Skip to content

Commit b98af53

Browse files
committed
Merge tag 'clocksource.2023.08.15a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull clocksource watchdog updates from Paul McKenney: - Handle negative skews in "skew is too large" messages - Extend watchdog check exemption to 4-Socket platforms * tag 'clocksource.2023.08.15a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: x86/tsc: Extend watchdog check exemption to 4-Sockets platform clocksource: Handle negative skews in "skew is too large" messages
2 parents b324696 + 233756a commit b98af53

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/x86/kernel/tsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ static void __init check_system_tsc_reliable(void)
12581258
if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
12591259
boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
12601260
boot_cpu_has(X86_FEATURE_TSC_ADJUST) &&
1261-
nr_online_nodes <= 2)
1261+
nr_online_nodes <= 4)
12621262
tsc_disable_clocksource_watchdog();
12631263
}
12641264

kernel/time/clocksource.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ static void clocksource_watchdog(struct timer_list *unused)
473473
/* Check the deviation from the watchdog clocksource. */
474474
md = cs->uncertainty_margin + watchdog->uncertainty_margin;
475475
if (abs(cs_nsec - wd_nsec) > md) {
476-
u64 cs_wd_msec;
477-
u64 wd_msec;
476+
s64 cs_wd_msec;
477+
s64 wd_msec;
478478
u32 wd_rem;
479479

480480
pr_warn("timekeeping watchdog on CPU%d: Marking clocksource '%s' as unstable because the skew is too large:\n",
@@ -483,8 +483,8 @@ static void clocksource_watchdog(struct timer_list *unused)
483483
watchdog->name, wd_nsec, wdnow, wdlast, watchdog->mask);
484484
pr_warn(" '%s' cs_nsec: %lld cs_now: %llx cs_last: %llx mask: %llx\n",
485485
cs->name, cs_nsec, csnow, cslast, cs->mask);
486-
cs_wd_msec = div_u64_rem(cs_nsec - wd_nsec, 1000U * 1000U, &wd_rem);
487-
wd_msec = div_u64_rem(wd_nsec, 1000U * 1000U, &wd_rem);
486+
cs_wd_msec = div_s64_rem(cs_nsec - wd_nsec, 1000 * 1000, &wd_rem);
487+
wd_msec = div_s64_rem(wd_nsec, 1000 * 1000, &wd_rem);
488488
pr_warn(" Clocksource '%s' skewed %lld ns (%lld ms) over watchdog '%s' interval of %lld ns (%lld ms)\n",
489489
cs->name, cs_nsec - wd_nsec, cs_wd_msec, watchdog->name, wd_nsec, wd_msec);
490490
if (curr_clocksource == cs)

0 commit comments

Comments
 (0)