]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
watchdog: Disable watchdog on virtual machines.
authorDave Jones <davej@redhat.com>
Tue, 24 Jun 2014 12:43:34 +0000 (08:43 -0400)
committerJulien Grall <julien.grall@citrix.com>
Fri, 18 Sep 2015 15:29:30 +0000 (16:29 +0100)
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.

Bugzilla: 971139
Upstream-status: Fedora mustard for now

Signed-off-by: Dave Jones <davej@redhat.com>
kernel/watchdog.c

index a6ffa43f299301dd750e9be092975df0d5e83786..b378b762844a9e713033d65097378e54d41dd822 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/smpboot.h>
 #include <linux/sched/rt.h>
 #include <linux/tick.h>
+#include <linux/dmi.h>
 
 #include <asm/irq_regs.h>
 #include <linux/kvm_para.h>
@@ -155,6 +156,32 @@ static int __init softlockup_all_cpu_backtrace_setup(char *str)
 __setup("softlockup_all_cpu_backtrace=", softlockup_all_cpu_backtrace_setup);
 #endif
 
+static int disable_watchdog(const struct dmi_system_id *d)
+{
+       printk(KERN_INFO "watchdog: disabled (inside virtual machine)\n");
+       watchdog_user_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"),
+               },
+       },
+       {}
+};
+
+
 /*
  * Hard-lockup warnings should be triggered after just a few seconds. Soft-
  * lockups can have false positives under extreme conditions. So we generally
@@ -928,6 +955,8 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write,
 
 void __init lockup_detector_init(void)
 {
+       dmi_check_system(watchdog_virt_dmi_table);
+
        set_sample_period();
 
 #ifdef CONFIG_NO_HZ_FULL