From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 18/21] Remove host_alarm_timer hacks. Date: Thu, 30 Apr 2009 08:19:40 -0500 Message-ID: <49F9A56C.5000705@us.ibm.com> References: <1241040038-17183-1-git-send-email-aliguori@us.ibm.com> <1241040038-17183-19-git-send-email-aliguori@us.ibm.com> <49F972EB.3040208@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from e39.co.us.ibm.com ([32.97.110.160]:35002 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758127AbZD3NTm (ORCPT ); Thu, 30 Apr 2009 09:19:42 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e39.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3UDGF9Y032628 for ; Thu, 30 Apr 2009 07:16:15 -0600 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3UDJfkM158992 for ; Thu, 30 Apr 2009 07:19:41 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3UDJfrK024060 for ; Thu, 30 Apr 2009 07:19:41 -0600 In-Reply-To: <49F972EB.3040208@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Anthony Liguori wrote: >> Signed-off-by: Anthony Liguori >> --- >> vl.c | 3 +-- >> 1 files changed, 1 insertions(+), 2 deletions(-) >> >> diff --git a/vl.c b/vl.c >> index 3b0e3dc..848a8f8 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -1367,8 +1367,7 @@ static void host_alarm_handler(int host_signum) >> last_clock = ti; >> } >> #endif >> - if (1 || >> - alarm_has_dynticks(alarm_timer) || >> + if (alarm_has_dynticks(alarm_timer) || >> (!use_icount && >> qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL], >> qemu_get_clock(vm_clock))) || >> > > This was added to fix a problem. Have you tested it? Do you know what problem it fixes? This goes back a very long time. IIUC, this was added prior to the IO thread as an "optimization". This ensures that any time there's a timer, the vcpu is interrupted to allow IO to run. With non-dynticks, there can be spurious timer signals because we problem the timer with a fixed frequency. It's necessary to take this path with dynticks because we need to rearm the timer which happens in the IO path. It's not necessary to take this path with a non-dynticks timer unless there's been an expiration. In modern KVM, the IO thread is capable of interrupting the CPU whenever it needs to process IO. Therefore this "problem" no longer exists. Regards, Anthony Liguori -- Regards, Anthony Liguori