From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161681AbcA1EyB (ORCPT ); Wed, 27 Jan 2016 23:54:01 -0500 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:37943 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161576AbcA1ExW (ORCPT ); Wed, 27 Jan 2016 23:53:22 -0500 x-originating-ip: 72.167.245.219 From: "K. Y. Srinivasan" To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com Cc: Dexuan Cui , "K. Y. Srinivasan" Subject: [PATCH V2 07/13] Drivers: hv: vmbus: vmbus_sendpacket_ctl: hvsock: avoid unnecessary signaling Date: Wed, 27 Jan 2016 22:29:39 -0800 Message-Id: <1453962585-32069-7-git-send-email-kys@microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453962585-32069-1-git-send-email-kys@microsoft.com> References: <1453962559-32028-1-git-send-email-kys@microsoft.com> <1453962585-32069-1-git-send-email-kys@microsoft.com> X-CMAE-Envelope: MS4wfDKghOydSO+n2OHhK8VvXnsDbJwwvYKr2OWzc8p7kWmLN7ZzN8xUQLomIPflya8FlQtQIsaCnLU5elqXSIeUWatkCwQe/i+S2FjMZDW4DSfOQgEQ4S3L xagKqQLji7RhsqqwNwO/Jwkodr+9ZKiHRzvPAVvcowNx4s5f4xlukW9vLmGBvu3Q3lMujtPWcs2omJ/FU+prK2/dxH6L3Rw+J5gSCsAkov0Rc409PmOMvzWX SoPsLATSWTvR92hnRtofFyeWHPi5MDT0dUjZzrtInXz6cgrxtkorTaFrqKC93fre2YpktbdeD8oyk/Nws4+7t6OmKjgd5BDASRnMgD7EsXrWZyOSQ8pbjXK9 7iTZiR+wVkuYe13kl8N3N0ua5kc/o1Ul2mueCJDQz+PTDwdPP3Chtd6dgYkXQHYlQ9P3Q/F9g1w0tp4lwRCyfJjSvtZ+Eg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui 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 Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 1161d68..3f04533 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; -- 1.7.4.1