From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35743 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ppcjm-0000ed-Bg for qemu-devel@nongnu.org; Wed, 16 Feb 2011 03:27:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ppcjg-0004O8-Ln for qemu-devel@nongnu.org; Wed, 16 Feb 2011 03:27:50 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:40952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ppcjg-0004NR-9j for qemu-devel@nongnu.org; Wed, 16 Feb 2011 03:27:44 -0500 Message-ID: <4D5B8A7E.2070005@web.de> Date: Wed, 16 Feb 2011 09:27:42 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20110215175410.GA13487@amt.cnet> <4D5ACCED.1080906@siemens.com> <20110215200446.GA15802@amt.cnet> <4D5AE2FC.4020309@web.de> <20110215205504.GA16527@amt.cnet> <20110215205631.GA16579@amt.cnet> In-Reply-To: <20110215205631.GA16579@amt.cnet> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig65207837E2E02BD4E16BA7C3" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2) 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) --------------enig65207837E2E02BD4E16BA7C3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-02-15 21:56, Marcelo Tosatti wrote: > Note: to be applied to uq/master. >=20 > In icount mode, halt emulation should take into account the nearest eve= nt when sleeping. >=20 > Signed-off-by: Marcelo Tosatti > Reported-and-tested-by: "Edgar E. Iglesias" >=20 > 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_ca= lculate_timeout()); > } > =20 > qemu_mutex_unlock(&qemu_global_mutex); As we agree that timeouts are wrong here, let's check if Paolo's patches make a difference. If not, it would still be better to understand the actual issue. After trying too many voodoo patches myself, I've finally found that mutex ping pong between iothread and vcpus by starring at a trace in kernelshar= k. Jan --------------enig65207837E2E02BD4E16BA7C3 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/ iEYEARECAAYFAk1bin4ACgkQitSsb3rl5xRkPACglD6si+V6Mu1O99fz2SkTSHzY kigAniZvvn95M+EaBML/5XwXxaPv1jTT =+Bot -----END PGP SIGNATURE----- --------------enig65207837E2E02BD4E16BA7C3--