From 18e50ce8f8d390b47ed295bbe96566c6bccf7e6f Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 11 Jun 2013 16:36:11 -0400 Subject: Disable soft lockup detector on virtual machines. (rhbz 971139) --- nowatchdog-on-virt.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 nowatchdog-on-virt.patch (limited to 'nowatchdog-on-virt.patch') diff --git a/nowatchdog-on-virt.patch b/nowatchdog-on-virt.patch new file mode 100644 index 00000000..b2064220 --- /dev/null +++ b/nowatchdog-on-virt.patch @@ -0,0 +1,67 @@ +Disable watchdog on virtual machines. + +For various reasons, VMs seem to trigger the soft lockup detector a lot, +in cases where it's just not possible for a lockup to occur. +(Example: https://bugzilla.redhat.com/show_bug.cgi?id=971139) + +In some cases it seems that the host just never scheduled the app running +the VM for a very long time (Could be the host was under heavy load). + +Just disable the detector on VMs. + +Signed-off-by: Dave Jones + +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 05039e3..a28aab9 100644 +--- a/kernel/watchdog.c ++++ b/kernel/watchdog.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -96,6 +97,32 @@ static int __init nosoftlockup_setup(char *str) + __setup("nosoftlockup", nosoftlockup_setup); + /* */ + ++static int disable_watchdog(const struct dmi_system_id *d) ++{ ++ printk(KERN_INFO "watchdog: disabled (inside virtual machine)\n"); ++ watchdog_enabled = 0; ++ return 0; ++} ++ ++static const struct dmi_system_id watchdog_virt_dmi_table[] = { ++ { ++ .callback = disable_watchdog, ++ .ident = "VMware", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "VMware, Inc."), ++ }, ++ }, ++ { ++ .callback = disable_watchdog, ++ .ident = "Bochs", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Bochs Bochs"), ++ }, ++ }, ++ {} ++}; ++ ++ + /* + * Hard-lockup warnings should be triggered after just a few seconds. Soft- + * lockups can have false positives under extreme conditions. So we generally +@@ -543,6 +570,8 @@ static struct smp_hotplug_thread watchdog_threads = { + + void __init lockup_detector_init(void) + { ++ dmi_check_system(watchdog_virt_dmi_table); ++ + set_sample_period(); + if (smpboot_register_percpu_thread(&watchdog_threads)) { + pr_err("Failed to create watchdog threads, disabled\n"); -- cgit