浏览代码

Drivers: hv: util: Increase the timeout for util services

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>
K. Y. Srinivasan 9 年之前
父节点
当前提交
c0b200cfb0
共有 3 个文件被更改,包括 9 次插入2 次删除
  1. 2 1
      drivers/hv/hv_fcopy.c
  2. 2 1
      drivers/hv/hv_kvp.c
  3. 5 0
      drivers/hv/hyperv_vmbus.h

+ 2 - 1
drivers/hv/hv_fcopy.c

@@ -275,7 +275,8 @@ void hv_fcopy_onchannelcallback(void *context)
 		 * Send the information to the user-level daemon.
 		 * Send the information to the user-level daemon.
 		 */
 		 */
 		schedule_work(&fcopy_send_work);
 		schedule_work(&fcopy_send_work);
-		schedule_delayed_work(&fcopy_timeout_work, 5*HZ);
+		schedule_delayed_work(&fcopy_timeout_work,
+				      HV_UTIL_TIMEOUT * HZ);
 		return;
 		return;
 	}
 	}
 	icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE;
 	icmsghdr->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE;

+ 2 - 1
drivers/hv/hv_kvp.c

@@ -668,7 +668,8 @@ void hv_kvp_onchannelcallback(void *context)
 			 * user-mode not responding.
 			 * user-mode not responding.
 			 */
 			 */
 			schedule_work(&kvp_sendkey_work);
 			schedule_work(&kvp_sendkey_work);
-			schedule_delayed_work(&kvp_timeout_work, 5*HZ);
+			schedule_delayed_work(&kvp_timeout_work,
+					      HV_UTIL_TIMEOUT * HZ);
 
 
 			return;
 			return;
 
 

+ 5 - 0
drivers/hv/hyperv_vmbus.h

@@ -30,6 +30,11 @@
 #include <linux/atomic.h>
 #include <linux/atomic.h>
 #include <linux/hyperv.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
  * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
  * is set by CPUID(HVCPUID_VERSION_FEATURES).
  * is set by CPUID(HVCPUID_VERSION_FEATURES).