Skip to content

Commit 58dedf0

Browse files
committed
Merge branch 'clocksource.2022.02.01b' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into timers/core
Pull clocksource watchdog update from Paul McKenney: - Add a config option for the maximum skew of the watchdog. Link: https://lore.kernel.org/r/20220224000718.GA3747431@paulmck-ThinkPad-P17-Gen-1
2 parents 7e57714 + fc153c1 commit 58dedf0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

kernel/time/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,14 @@ config HIGH_RES_TIMERS
181181
hardware is not capable then this option only increases
182182
the size of the kernel image.
183183

184+
config CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
185+
int "Clocksource watchdog maximum allowable skew (in μs)"
186+
depends on CLOCKSOURCE_WATCHDOG
187+
range 50 1000
188+
default 100
189+
help
190+
Specify the maximum amount of allowable watchdog skew in
191+
microseconds before reporting the clocksource to be unstable.
192+
184193
endmenu
185194
endif

kernel/time/clocksource.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ static u64 suspend_start;
107107
* This delay could be due to SMIs, NMIs, or to VCPU preemptions. Used as
108108
* a lower bound for cs->uncertainty_margin values when registering clocks.
109109
*/
110-
#define WATCHDOG_MAX_SKEW (100 * NSEC_PER_USEC)
110+
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
111+
#define MAX_SKEW_USEC CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
112+
#else
113+
#define MAX_SKEW_USEC 100
114+
#endif
115+
116+
#define WATCHDOG_MAX_SKEW (MAX_SKEW_USEC * NSEC_PER_USEC)
111117

112118
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
113119
static void clocksource_watchdog_work(struct work_struct *work);

0 commit comments

Comments
 (0)