diff options
author | Ulrich Obergfell <uobergfe@redhat.com> | 2014-10-03 09:31:27 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-10-09 17:23:40 +1100 |
commit | 0de4da0772246d9445d54b31d39606bb20536889 (patch) | |
tree | cfed838866aad51d89aaf8255b6c0c8bc2d70c3a /include | |
parent | db802d611d12b9bf425d050684d60f4bcf9c6086 (diff) |
kernel/watchdog.c: control hard lockup detection default
In some cases we don't want hard lockup detection enabled by default. An
example is when running as a guest. Introduce
watchdog_enable_hardlockup_detector(bool)
allowing those cases to disable hard lockup detection. This must be
executed early by the boot processor from e.g. smp_prepare_boot_cpu, in
order to allow kernel command line arguments to override it, as well as to
avoid hard lockup detection being enabled before we've had a chance to
indicate that it's unwanted. In summary,
initial boot: default=enabled
smp_prepare_boot_cpu
watchdog_enable_hardlockup_detector(false): default=disabled
cmdline has 'nmi_watchdog=1': default=enabled
The running kernel still has the ability to enable/disable at any time
with /proc/sys/kernel/nmi_watchdog us usual. However even when the
default has been overridden /proc/sys/kernel/nmi_watchdog will initially
show '1'. To truly turn it on one must disable/enable it, i.e.
echo 0 > /proc/sys/kernel/nmi_watchdog
echo 1 > /proc/sys/kernel/nmi_watchdog
This patch will be immediately useful for KVM with the next patch of this
series. Other hypervisor guest types may find it useful as well.
Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nmi.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 1d2a6ab6b8bb..7696a163d820 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -17,11 +17,20 @@ #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) #include <asm/nmi.h> extern void touch_nmi_watchdog(void); +extern void watchdog_enable_hardlockup_detector(bool val); +extern bool watchdog_hardlockup_detector_is_enabled(void); #else static inline void touch_nmi_watchdog(void) { touch_softlockup_watchdog(); } +static inline void watchdog_enable_hardlockup_detector(bool) +{ +} +static inline bool watchdog_hardlockup_detector_is_enabled(void) +{ + return true; +} #endif /* |