Drivers: hv: vmbus: Increase wait time for VMbus unload
authorMichael Kelley <mikelley@microsoft.com>
Tue, 20 Apr 2021 04:48:09 +0000 (21:48 -0700)
committerWei Liu <wei.liu@kernel.org>
Tue, 20 Apr 2021 19:41:33 +0000 (19:41 +0000)
commit77db0ec8b7764cb9b09b78066ebfd47b2c0c1909
treee4c07a23a743fb1369ce43a3a9488915d143f51b
parent8c2d5e0640e53c14b6240e9bf1e32a2226e6e6ca
Drivers: hv: vmbus: Increase wait time for VMbus unload

When running in Azure, disks may be connected to a Linux VM with
read/write caching enabled. If a VM panics and issues a VMbus
UNLOAD request to Hyper-V, the response is delayed until all dirty
data in the disk cache is flushed.  In extreme cases, this flushing
can take 10's of seconds, depending on the disk speed and the amount
of dirty data. If kdump is configured for the VM, the current 10 second
timeout in vmbus_wait_for_unload() may be exceeded, and the UNLOAD
complete message may arrive well after the kdump kernel is already
running, causing problems.  Note that no problem occurs if kdump is
not enabled because Hyper-V waits for the cache flush before doing
a reboot through the BIOS/UEFI code.

Fix this problem by increasing the timeout in vmbus_wait_for_unload()
to 100 seconds. Also output periodic messages so that if anyone is
watching the serial console, they won't think the VM is completely
hung.

Fixes: 911e1987efc8 ("Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload")
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/1618894089-126662-1-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/channel_mgmt.c