From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L51g3-0005GH-TG for qemu-devel@nongnu.org; Tue, 25 Nov 2008 12:26:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L51g3-0005Fw-E7 for qemu-devel@nongnu.org; Tue, 25 Nov 2008 12:26:19 -0500 Received: from [199.232.76.173] (port=54990 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L51g3-0005Fs-Ad for qemu-devel@nongnu.org; Tue, 25 Nov 2008 12:26:19 -0500 Received: from savannah.gnu.org ([199.232.41.3]:50263 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L51g2-00040b-RV for qemu-devel@nongnu.org; Tue, 25 Nov 2008 12:26:19 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1L51fu-0005FY-FB for qemu-devel@nongnu.org; Tue, 25 Nov 2008 17:26:10 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1L51fu-0005FS-5d for qemu-devel@nongnu.org; Tue, 25 Nov 2008 17:26:10 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Tue, 25 Nov 2008 17:26:10 +0000 Subject: [Qemu-devel] [5796] Revert r5636 to fix icount on hosts w/o high-res clocks Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5796 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5796 Author: aliguori Date: 2008-11-25 17:26:09 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Revert r5636 to fix icount on hosts w/o high-res clocks Changeset r5636 changed the timers to run in the alarm callback. The alarm callback can only be called as frequently as the host alarm timer fires. For older Linux hosts and possibly non-Linux hosts, this can be as high as a 1ms granularity. icount calculates the select timeout based on the next deadline and select is usually capable of sleeping for a short period of time than alarm timer granularity. This means that changing the timer callbacks to be based on alarm firing caused timers to fire much later than they ought to when using icount. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/vl.c Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2008-11-25 17:19:45 UTC (rev 5795) +++ trunk/vl.c 2008-11-25 17:26:09 UTC (rev 5796) @@ -1624,15 +1624,6 @@ } while ((len == -1 && errno == EINTR) || len > 0); #endif - /* vm time timers */ - if (vm_running && likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER))) - qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL], - qemu_get_clock(vm_clock)); - - /* real time timers */ - qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME], - qemu_get_clock(rt_clock)); - if (t->flags & ALARM_FLAG_EXPIRED) { alarm_timer->flags &= ~ALARM_FLAG_EXPIRED; qemu_rearm_alarm_timer(alarm_timer); @@ -3629,6 +3620,15 @@ } #endif + /* vm time timers */ + if (vm_running && likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER))) + qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL], + qemu_get_clock(vm_clock)); + + /* real time timers */ + qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME], + qemu_get_clock(rt_clock)); + /* Check bottom-halves last in case any of the earlier events triggered them. */ qemu_bh_poll();