summaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel.c
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2016-01-27 22:29:39 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 21:34:12 -0800
commit5f363bc38f810d238d1e8b19998625ddec3b8138 (patch)
tree1f4c250e523d5764966847ac122f41780d7e2d50 /drivers/hv/channel.c
parente8d6ca023efce3bd80050dcd9e708ee3cf8babd4 (diff)
downloadlinux-5f363bc38f810d238d1e8b19998625ddec3b8138.tar.bz2
Drivers: hv: vmbus: vmbus_sendpacket_ctl: hvsock: avoid unnecessary signaling
When the hvsock channel's outbound ringbuffer is full (i.e., hv_ringbuffer_write() returns -EAGAIN), we should avoid the unnecessary signaling the host. Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/channel.c')
-rw-r--r--drivers/hv/channel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 1161d68a1863..3f0453302146 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -659,6 +659,9 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer,
* If we cannot write to the ring-buffer; signal the host
* even if we may not have written anything. This is a rare
* enough condition that it should not matter.
+ * NOTE: in this case, the hvsock channel is an exception, because
+ * it looks the host side's hvsock implementation has a throttling
+ * mechanism which can hurt the performance otherwise.
*/
if (channel->signal_policy)
@@ -666,7 +669,8 @@ int vmbus_sendpacket_ctl(struct vmbus_channel *channel, void *buffer,
else
kick_q = true;
- if (((ret == 0) && kick_q && signal) || (ret))
+ if (((ret == 0) && kick_q && signal) ||
+ (ret && !is_hvsock_channel(channel)))
vmbus_setevent(channel);
return ret;