From patchwork Tue Jun 12 13:32:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 164417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 58D5DB700D for ; Tue, 12 Jun 2012 23:33:04 +1000 (EST) Received: from localhost ([::1]:54462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeRDS-0006IY-54 for incoming@patchwork.ozlabs.org; Tue, 12 Jun 2012 09:33:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeRDA-0006IP-Gb for qemu-devel@nongnu.org; Tue, 12 Jun 2012 09:32:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeRD4-0007Lx-PA for qemu-devel@nongnu.org; Tue, 12 Jun 2012 09:32:44 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:52121 helo=SMTP.EU.CITRIX.COM) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeRD4-0007KW-IR for qemu-devel@nongnu.org; Tue, 12 Jun 2012 09:32:38 -0400 X-IronPort-AV: E=Sophos;i="4.75,758,1330905600"; d="scan'208";a="12968968" Received: from lonpmailmx01.citrite.net ([10.30.203.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 12 Jun 2012 13:32:21 +0000 Received: from kaball.uk.xensource.com (10.80.2.59) by LONPMAILMX01.citrite.net (10.30.203.162) with Microsoft SMTP Server id 8.3.213.0; Tue, 12 Jun 2012 14:32:21 +0100 Date: Tue, 12 Jun 2012 14:32:00 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: =?UTF-8?Q?Andreas_F=C3=A4rber?= In-Reply-To: <4FD73CEE.8080905@web.de> Message-ID: References: <4FD6FCCE.8080807@web.de> <4FD6FF52.9030001@web.de> <4FD73CEE.8080905@web.de> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.200.22.115 Cc: Stefano Stabellini , Stefan Hajnoczi , "qemu-devel@nongnu.org" , Anthony Liguori , Stefan Weil , Paolo Bonzini Subject: Re: [Qemu-devel] qemu_rearm_alarm_timer: do not call rearm if the next deadline is INT64_MAX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Tue, 12 Jun 2012, Andreas Färber wrote: > Am 12.06.2012 14:37, schrieb Stefano Stabellini: > > On Tue, 12 Jun 2012, Andreas Färber wrote: > >> Am 12.06.2012 10:24, schrieb Andreas Färber: > >>> Am 29.05.2012 15:35, schrieb Stefano Stabellini: > >>> The check-qtest-i386 qemu-system-i386 process now hangs at ~98% CPU, > > > > Does this mean that increasing the timeout caused a busy loop somewhere > > in the test? But if we set the max timeout value to INT32_MAX doesn't > > happen? > > Note that this is solely about qtest, which I never saw working > (probably didn't try before). Regular system emulation seemed to work > just fine. > > Where would I try INT32_MAX for comparison? the following patch (to be applied on top of the other one) should do the trick: diff --git a/qemu-timer.c b/qemu-timer.c index d37a978..4fd3e1c 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -85,7 +85,7 @@ static bool qemu_timer_expired_ns(QEMUTimer *timer_head, int64_t current_time) static int64_t qemu_next_alarm_deadline(void) { - int64_t delta = INT64_MAX; + int64_t delta = INT32_MAX; int64_t rtdelta; if (!use_icount && vm_clock->enabled && vm_clock->active_timers) { @@ -113,7 +113,7 @@ static int64_t qemu_next_alarm_deadline(void) static void qemu_rearm_alarm_timer(struct qemu_alarm_timer *t) { int64_t nearest_delta_ns = qemu_next_alarm_deadline(); - if (nearest_delta_ns < INT64_MAX) { + if (nearest_delta_ns < INT32_MAX) { t->rearm(t, nearest_delta_ns); } }