Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IcMwI-0006Tz-OK for qemu-devel@nongnu.org; Mon, 01 Oct 2007 11:12:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IcMwG-0006Po-EN for qemu-devel@nongnu.org; Mon, 01 Oct 2007 11:12:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IcMwG-0006Pd-Az for qemu-devel@nongnu.org; Mon, 01 Oct 2007 11:12:04 -0400 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IcMwF-0000kd-Ss for qemu-devel@nongnu.org; Mon, 01 Oct 2007 11:12:04 -0400 Received: from localhost (karma.qumranet.com [10.0.50.239]) by il.qumranet.com (Postfix) with ESMTP id 97855250D41 for ; Mon, 1 Oct 2007 17:12:03 +0200 (IST) Date: Mon, 1 Oct 2007 17:09:53 +0200 From: Dan Kenigsberg Message-ID: <20071001150953.GA19458@karma.qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] redundant qemu_rearm_alarm_timer() in qemu_del_timer() 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 There is no need to rearm the alarm timer when a qemu timer is deleted. The current code contains a redundant rearm whenever qemu_del_timer() is used, which is very often - in every qemu_mod_timer(). The rearm in qemu_mod_timer() is redundant because a currently-set timer could not be brought forward due to delete - only postponed. And postponing the timer is better done once in the end of qemu_run_timers(). Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.343 diff -u -p -r1.343 vl.c --- vl.c 29 Sep 2007 19:24:40 -0000 1.343 +++ vl.c 1 Oct 2007 14:13:01 -0000 @@ -988,8 +988,6 @@ void qemu_del_timer(QEMUTimer *ts) } pt = &t->next; } - - qemu_rearm_alarm_timer(alarm_timer); } /* modify the current timer so that it will be fired when current_time