From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44442 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpRcX-0002jt-1k for qemu-devel@nongnu.org; Tue, 15 Feb 2011 15:35:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpRcV-0000KX-4O for qemu-devel@nongnu.org; Tue, 15 Feb 2011 15:35:36 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:35362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpRcU-0000Js-JQ for qemu-devel@nongnu.org; Tue, 15 Feb 2011 15:35:35 -0500 Message-ID: <4D5AE2FC.4020309@web.de> Date: Tue, 15 Feb 2011 21:33:00 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20110215175410.GA13487@amt.cnet> <4D5ACCED.1080906@siemens.com> <20110215200446.GA15802@amt.cnet> In-Reply-To: <20110215200446.GA15802@amt.cnet> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig33662C222DA2F6E4E9ACC5D7" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: "Edgar E. Iglesias" , "qemu-devel@nongnu.org" , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig33662C222DA2F6E4E9ACC5D7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-02-15 21:04, Marcelo Tosatti wrote: > On Tue, Feb 15, 2011 at 07:58:53PM +0100, Jan Kiszka wrote: >> On 2011-02-15 18:54, Marcelo Tosatti wrote: >>> >>> Note: to be applied to uq/master. >>> >>> In icount mode, halt emulation should take into account the nearest e= vent when sleeping. >>> >>> Signed-off-by: Marcelo Tosatti >>> Reported-and-tested-by: "Edgar E. Iglesias" >>> >>> diff --git a/cpus.c b/cpus.c >>> index 468544c..21c3eba 100644 >>> --- a/cpus.c >>> +++ b/cpus.c >>> @@ -770,7 +770,7 @@ static void qemu_tcg_wait_io_event(void) >>> CPUState *env; >>> =20 >>> while (all_cpu_threads_idle()) { >>> - qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, 1000)= ; >>> + qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, qemu_= calculate_timeout()); >> >> checkpatch.pl would complain here. >> >> More important: Paolo was proposing patches to eliminate all those fis= hy >> cond_wait timeouts. That's probably the better way to go. The timeouts= >> only paper over missing signaling. >> >>> } >>> =20 >>> qemu_mutex_unlock(&qemu_global_mutex); >>> diff --git a/vl.c b/vl.c >>> index b436952..8ba7e9d 100644 >>> --- a/vl.c >>> +++ b/vl.c >>> @@ -1335,7 +1335,7 @@ void main_loop_wait(int nonblocking) >>> if (nonblocking) >>> timeout =3D 0; >>> else { >>> - timeout =3D qemu_calculate_timeout(); >>> + timeout =3D 1000; >>> qemu_bh_update_timeout(&timeout); >>> } >>> =20 >> >> Isn't this path also relevant for !IOTHREAD? What's the impact of this= >> change for that configuration? >=20 > Timeout changes from 5s to 1s. >=20 =2E.. if (!vm_running). This patch does have side effects on !IOTHREAD. I doubt the above hunk can be correct. What kind of timeout is qemu_calculate_timeout returning? Jan --------------enig33662C222DA2F6E4E9ACC5D7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk1a4wIACgkQitSsb3rl5xT0dgCg1rUDf+9lCEW62nwKeiwXanxH 3lEAoI1EgOteObqZ/VCKvOVt5GV6fctN =lBV9 -----END PGP SIGNATURE----- --------------enig33662C222DA2F6E4E9ACC5D7--