Skip to content

Commit

Permalink
Drivers: hv: vmbus: vmbus_sendpacket_ctl: hvsock: avoid unnecessary s…
Browse files Browse the repository at this point in the history
…ignaling

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>
  • Loading branch information
Dexuan Cui authored and Greg Kroah-Hartman committed Feb 8, 2016
1 parent e8d6ca0 commit 5f363bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,18 @@ 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)
signal = true;
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;
Expand Down

0 comments on commit 5f363bc

Please sign in to comment.