From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Smetanin Subject: Re: [PATCH v1 3/6] kvm/x86: Reorg stimer_expiration() to better control timer restart Date: Thu, 7 Jan 2016 23:13:35 +0300 Message-ID: <568EC6EF.90102@virtuozzo.com> References: <1450870121-15943-1-git-send-email-asmetanin@virtuozzo.com> <1450870121-15943-4-git-send-email-asmetanin@virtuozzo.com> <568E93AE.1050401@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Roman Kagan , "Denis V. Lunev" , To: Paolo Bonzini , Return-path: Received: from mx2.parallels.com ([199.115.105.18]:48363 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbcAGUOZ (ORCPT ); Thu, 7 Jan 2016 15:14:25 -0500 In-Reply-To: <568E93AE.1050401@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/07/2016 07:34 PM, Paolo Bonzini wrote: > > > On 23/12/2015 12:28, Andrey Smetanin wrote: >> - stimer_send_msg(stimer); >> - if (!(stimer->config & HV_STIMER_PERIODIC)) >> - stimer->config |= ~HV_STIMER_ENABLE; >> - else >> - stimer_start(stimer); >> + stimer->msg_pending = true; >> + if (!stimer_send_msg(stimer)) { >> + stimer->msg_pending = false; >> + if (!(stimer->config & HV_STIMER_PERIODIC)) >> + stimer->config |= ~HV_STIMER_ENABLE; > > Just because this is curious: sure it shouldn't be "&="? You are right, we found it too late - only by testing Linux guest Hyper-v timers which are one-shot timers. We have fixed it in v2. > > Paolo > >> + } From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHGx8-0000Ux-DJ for qemu-devel@nongnu.org; Thu, 07 Jan 2016 15:14:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHGx3-0004YK-E8 for qemu-devel@nongnu.org; Thu, 07 Jan 2016 15:14:34 -0500 Received: from mx2.parallels.com ([199.115.105.18]:34514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHGx3-0004Vx-8B for qemu-devel@nongnu.org; Thu, 07 Jan 2016 15:14:29 -0500 References: <1450870121-15943-1-git-send-email-asmetanin@virtuozzo.com> <1450870121-15943-4-git-send-email-asmetanin@virtuozzo.com> <568E93AE.1050401@redhat.com> From: Andrey Smetanin Message-ID: <568EC6EF.90102@virtuozzo.com> Date: Thu, 7 Jan 2016 23:13:35 +0300 MIME-Version: 1.0 In-Reply-To: <568E93AE.1050401@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 3/6] kvm/x86: Reorg stimer_expiration() to better control timer restart List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , kvm@vger.kernel.org Cc: Gleb Natapov , "Denis V. Lunev" , Roman Kagan , qemu-devel@nongnu.org On 01/07/2016 07:34 PM, Paolo Bonzini wrote: > > > On 23/12/2015 12:28, Andrey Smetanin wrote: >> - stimer_send_msg(stimer); >> - if (!(stimer->config & HV_STIMER_PERIODIC)) >> - stimer->config |= ~HV_STIMER_ENABLE; >> - else >> - stimer_start(stimer); >> + stimer->msg_pending = true; >> + if (!stimer_send_msg(stimer)) { >> + stimer->msg_pending = false; >> + if (!(stimer->config & HV_STIMER_PERIODIC)) >> + stimer->config |= ~HV_STIMER_ENABLE; > > Just because this is curious: sure it shouldn't be "&="? You are right, we found it too late - only by testing Linux guest Hyper-v timers which are one-shot timers. We have fixed it in v2. > > Paolo > >> + }