Disable soft lockup detector on virtual machines. (rhbz 971139)

This commit is contained in:
Dave Jones 2013-06-11 16:36:11 -04:00
parent d08f67e2b7
commit 18e50ce8f8
2 changed files with 75 additions and 0 deletions

View File

@ -694,6 +694,8 @@ Patch14000: hibernate-freeze-filesystems.patch
Patch14010: lis3-improve-handling-of-null-rate.patch Patch14010: lis3-improve-handling-of-null-rate.patch
Patch15000: nowatchdog-on-virt.patch
# ARM # ARM
Patch21000: arm-export-read_current_timer.patch Patch21000: arm-export-read_current_timer.patch
@ -1418,6 +1420,9 @@ ApplyPatch efi-dont-map-boot-services-on-32bit.patch
ApplyPatch lis3-improve-handling-of-null-rate.patch ApplyPatch lis3-improve-handling-of-null-rate.patch
# Disable watchdog on virtual machines.
ApplyPatch nowatchdog-on-virt.patch
#rhbz 754518 #rhbz 754518
ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
@ -2278,6 +2283,9 @@ fi
# ||----w | # ||----w |
# || || # || ||
%changelog %changelog
* Tue Jun 11 2013 Dave Jones <davej@redhat.com>
- Disable soft lockup detector on virtual machines. (rhbz 971139)
* Tue Jun 11 2013 Josh Boyer <jwboyer@redhat.com> * Tue Jun 11 2013 Josh Boyer <jwboyer@redhat.com>
- Add patches to fix MTRR issues in 3.9.5 (rhbz 973185) - Add patches to fix MTRR issues in 3.9.5 (rhbz 973185)
- Add two patches to fix issues with vhost_net and macvlan (rhbz 954181) - Add two patches to fix issues with vhost_net and macvlan (rhbz 954181)

67
nowatchdog-on-virt.patch Normal file
View File

@ -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 <davej@redhat.com>
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 <linux/sysctl.h>
#include <linux/smpboot.h>
#include <linux/sched/rt.h>
+#include <linux/dmi.h>
#include <asm/irq_regs.h>
#include <linux/kvm_para.h>
@@ -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");