From patchwork Tue Jan 26 09:44:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 573121 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E3F0F140216 for ; Tue, 26 Jan 2016 19:10:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933558AbcAZIIT (ORCPT ); Tue, 26 Jan 2016 03:08:19 -0500 Received: from p3plsmtps2ded04.prod.phx3.secureserver.net ([208.109.80.198]:36292 "EHLO p3plsmtps2ded04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932734AbcAZIIN (ORCPT ); Tue, 26 Jan 2016 03:08:13 -0500 Received: from linuxonhyperv.com ([72.167.245.219]) by : HOSTING RELAY : with SMTP id Nyfba71JeWOsdNyfbahjO1; Tue, 26 Jan 2016 01:08:13 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 518) id 82E3C19025B; Tue, 26 Jan 2016 01:44:30 -0800 (PST) From: Dexuan Cui To: gregkh@linuxfoundation.org, davem@davemloft.net, stephen@networkplumber.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, kys@microsoft.com, vkuznets@redhat.com Cc: pebolle@tiscali.nl, stefanha@redhat.com, dan.carpenter@oracle.com Subject: [PATCH V6 3/8] Drivers: hv: vmbus: vmbus_sendpacket_ctl: hvsock: avoid unnecessary signaling Date: Tue, 26 Jan 2016 01:44:30 -0800 Message-Id: <1453801470-3331-1-git-send-email-decui@microsoft.com> X-Mailer: git-send-email 1.7.4.1 X-CMAE-Envelope: MS4wfCjt/hcr4FiMizl+q/JLXLDjIaSUGaFAN8JXxX10pi2laZqmv6FGj0ReN1dfNcvwpSWoJnVeGJScYNLBwJBiwonT5nIp7IxYSHbNz9w8nN4iHG37yj2Y jj0wanQoBYsf2fg9dBrGn7/lJn4iblAfrsTY2ksN/uJCAoce8ymKgfLiusoKiIqCP37tWZKRNoC2foMBGD3BRAp61EHFpulKhHdZiB4kkZDMmqIiJh/ZPK95 8gd2EXntskoN+OD8NukVzwQhk7UkJ7Ox1y4Rb52iZ5Pp9KKnir9rtfkIbc/oKeUm2i7L0J7LMQfbGvFTwEGPrLkGdvudcTHlp8srcls/uT+qeJ2+ZkdFwV8n 7/7AlnfbjIMlHMDw/C6a/mL5U9xbzHjUIXIn3yFghVSPXEwVppIqyuSWf67sp/Fk5olqSNv/zjWrLrvC82IGfjcIr0d8N4E2eJcIfGwnqW1yl07UZSfWC/Gp 9kBxCWMkbANI0l7DZwOgywMWb/ss+d3njpmwbxZ64I8m0uqxO4gO9ViFj4uKpst/M+7cnt52woQUPavFMPXFHNZZsPHQ6tDmB3CKZs81QFywuyTzUGr1BR3N CMzYxXf2Hfp7ezRdvSOKDTKxlf7a1YLpuhFceQgKcCq1bw== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/hv/channel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;