From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbcBOUur (ORCPT ); Mon, 15 Feb 2016 15:50:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41837 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbcBOUue (ORCPT ); Mon, 15 Feb 2016 15:50:34 -0500 Date: Mon, 15 Feb 2016 21:50:30 +0100 From: Radim Krcmar To: Vitaly Kuznetsov Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Cathy Avery Subject: Re: [PATCH 1/4] Drivers: hv: vmbus: don't loose HVMSG_TIMER_EXPIRED messages Message-ID: <20160215205030.GC10555@potion.brq.redhat.com> References: <1455291770-15672-1-git-send-email-vkuznets@redhat.com> <1455291770-15672-2-git-send-email-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1455291770-15672-2-git-send-email-vkuznets@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-02-12 16:42+0100, Vitaly Kuznetsov: > We must handle HVMSG_TIMER_EXPIRED messages in the interrupt context > and we offload all the rest to vmbus_on_msg_dpc() tasklet. This functions > loops to see if there are new messages pending. In case we'll ever see > HVMSG_TIMER_EXPIRED message there we're going to lose it as we can't > handle it from there. Avoid looping in vmbus_on_msg_dpc(), we're OK > with handling one message per interrupt. We could loop as long as the message type is handleable in the tasklet, which might increase performance, but the code nicer this way; Reviewed-by: Radim Krčmář > Signed-off-by: Vitaly Kuznetsov > --- > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > @@ -716,51 +716,49 @@ static void vmbus_on_msg_dpc(unsigned long data) > struct vmbus_channel_message_table_entry *entry; > struct onmessage_work_context *ctx; > > - while (1) { > - if (msg->header.message_type == HVMSG_NONE) > - /* no msg */ > - break; > + if (msg->header.message_type == HVMSG_NONE) (This condition should never be true now.) > + /* no msg */ > + return; Btw. what is/are the other HVMSG_* that we get?