Skip to content

Commit fc153c1

Browse files
Waiman-Longpaulmckrcu
authored andcommitted
clocksource: Add a Kconfig option for WATCHDOG_MAX_SKEW
A watchdog maximum skew of 100us may still be too small for some systems or archs. It may also be too small when some kernel debug config options are enabled. So add a new Kconfig option CLOCKSOURCE_WATCHDOG_MAX_SKEW_US to allow kernel builders to have more control on the threshold for marking clocksource as unstable. Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent da12301 commit fc153c1

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)