Drivers: hv: util: Increase the timeout for util services
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 15 Dec 2015 00:01:32 +0000 (16:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Dec 2015 03:12:21 +0000 (19:12 -0800)
Util services such as KVP and FCOPY need assistance from daemon's running
in user space. Increase the timeout so we don't prematurely terminate
the transaction in the kernel. Host sets up a 60 second timeout for
all util driver transactions. The host will retry the transaction if it
times out. Set the guest timeout at 30 seconds.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_fcopy.c
drivers/hv/hv_kvp.c
drivers/hv/hyperv_vmbus.h

index db4b887b889d268c3e427764e732ce88dc6a008e..bbdec50c4a1c1ff799637c6b3da4b73b0558edc7 100644 (file)
@@ -275,7 +275,8 @@ void hv_fcopy_onchannelcallback(void *context)
                 * Send the information to the user-level daemon.
                 */
                schedule_work(&fcopy_send_work);
-               schedule_delayed_work(&fcopy_timeout_work, 5*HZ);
+               schedule_delayed_work(&fcopy_timeout_work,
+                                     HV_UTIL_TIMEOUT * HZ);
                return;
        }
        icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE;
index 74c38a9f34a609369fc84b9e0c5ce4a4c7de5931..e6aa33a89b0ea2a921d6703b2d3d65d031c06c11 100644 (file)
@@ -668,7 +668,8 @@ void hv_kvp_onchannelcallback(void *context)
                         * user-mode not responding.
                         */
                        schedule_work(&kvp_sendkey_work);
-                       schedule_delayed_work(&kvp_timeout_work, 5*HZ);
+                       schedule_delayed_work(&kvp_timeout_work,
+                                             HV_UTIL_TIMEOUT * HZ);
 
                        return;
 
index 3782636562a1b0c2b7d16273c14db14e8549e768..225b96bcf7fe132e3525e65ee569324b7f293bc8 100644 (file)
 #include <linux/atomic.h>
 #include <linux/hyperv.h>
 
+/*
+ * Timeout for services such as KVP and fcopy.
+ */
+#define HV_UTIL_TIMEOUT 30
+
 /*
  * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
  * is set by CPUID(HVCPUID_VERSION_FEATURES).