[PATCH] time: Make the clocksource watchdog user configurable

From: Gratian Crisan
Date: Thu Apr 07 2016 - 00:20:15 EST


The clocksource watchdog is used to detect instabilities in the current
clocksource. This is a beneficial feature on new/unknown hardware however
it can create problems by falsely triggering when the watchdog wraps. The
reason is that an interrupt storm and/or high priority (FIFO/RR) tasks can
preempt the timer softirq long enough for the watchdog to wrap if it has a
limited number of bits available by comparison with the main clocksource.

One observed example is on a Intel Baytrail platform where TSC is the main
clocksource, HPET is disabled due to a hardware bug and acpi_pm gets
selected as the watchdog clocksource.

Provide the option to disable the clocksource watchdog for hardware where
the clocksource stability has been validated.

Signed-off-by: Gratian Crisan <gratian.crisan@xxxxxx>
---
arch/x86/Kconfig | 2 +-
kernel/time/Kconfig | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2dc18605..6da5d9e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -54,7 +54,7 @@ config X86
select CLKEVT_I8253
select CLKSRC_I8253 if X86_32
select CLOCKSOURCE_VALIDATE_LAST_CYCLE
- select CLOCKSOURCE_WATCHDOG
+ select HAVE_CLOCKSOURCE_WATCHDOG
select CLONE_BACKWARDS if X86_32
select COMPAT_OLD_SIGACTION if IA32_EMULATION
select DCACHE_WORD_ACCESS
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 4008d9f..6707f1d 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -5,7 +5,7 @@
# Options selectable by arch Kconfig

# Watchdog function for clocksources to detect instabilities
-config CLOCKSOURCE_WATCHDOG
+config HAVE_CLOCKSOURCE_WATCHDOG
bool

# Architecture has extra clocksource data
@@ -193,5 +193,15 @@ config HIGH_RES_TIMERS
hardware is not capable then this option only increases
the size of the kernel image.

+config CLOCKSOURCE_WATCHDOG
+ bool "Clocksource watchdog"
+ depends on HAVE_CLOCKSOURCE_WATCHDOG
+ default y
+ help
+ This option enables the watchdog function for clocksources. It is
+ used to detect instabilities in the currently selected clocksource.
+
+ Say Y if you are unsure.
+
endmenu
endif
--
1.9.1