Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2998793AbdD3XeD (ORCPT ); Sun, 30 Apr 2017 19:34:03 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:45510 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1951332AbdD3Xdl (ORCPT ); Sun, 30 Apr 2017 19:33:41 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, leann.ogasawara@canonical.comi, marcelo.cerri@canonical.com, sthemmin@microsoft.com Cc: "K. Y. Srinivasan" Subject: [PATCH 4/6] Drivers: hv: util: Make hv_poll_channel() a little more efficient Date: Sun, 30 Apr 2017 16:21:17 -0700 Message-Id: <1493594479-25329-4-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1493594420-25214-1-git-send-email-kys@exchange.microsoft.com> References: <1493594420-25214-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfOXFF4e7MMh8pSgsmvm/wA65IlVCyEM9VvA6uJ7ovrIjj0KUe3tp3MzJxdzD8B3L9JCXlVzSgYxnlzrWdIlz0lhqAHTdR7m+U3B/qBjAwyL9AJHsgUFl cge+6diksPSDrQt0k7a+PsgV/AEthK1QYrCd/ZbwiyM7rEgFbI+/Oq8X1/SRWQr5rD01QRoTPWS0WPouooIGppLWM4b9BhDO+za49RlcmO0TJvdAq5UxaDZm xy6TE6wjaLbTmTj1CXDfvdUj6UUxbicj4CISDJGXHEzaOY6nURNAIWJLG6kCJHh2qfJdFj1ZPLro4QFMdvscJ+vKcNEEKW2uOL2lhY7buaocOq5YlbmjfZyc X2AlbWw86v+bGb6WdnaElm790TWz3Y5nFINlpheNfGC8doqlC0Crm0zztDRq9UxSf0HbTbEFaJCAZiyl0oST1cIjyvcmJy0JJr/bICREGYXUu0LjSn5i2TSC 1wT+1K+wT35JHu16Gm1nOSO8EJoKrgSHx2jhB7JRBL/ddTWrseHzK3CI+os= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 809 Lines: 28 From: K. Y. Srinivasan The current code unconditionally sends an IPI. If we are running on the correct CPU and are in interrupt level, we don't need an IPI. Make this adjustment. Signed-off-by: K. Y. Srinivasan --- drivers/hv/hyperv_vmbus.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6113e91..fa514be 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -411,6 +411,10 @@ static inline void hv_poll_channel(struct vmbus_channel *channel, if (!channel) return; + if (in_interrupt() && (channel->target_cpu == smp_processor_id())) { + cb(channel); + return; + } smp_call_function_single(channel->target_cpu, cb, channel, true); } -- 1.7.1