From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kx7W0-0000NN-BO for qemu-devel@nongnu.org; Mon, 03 Nov 2008 17:03:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kx7Vy-0000Md-O1 for qemu-devel@nongnu.org; Mon, 03 Nov 2008 17:03:15 -0500 Received: from [199.232.76.173] (port=55744 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx7Vy-0000MR-Jl for qemu-devel@nongnu.org; Mon, 03 Nov 2008 17:03:14 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:59729) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kx7Vx-0005W5-Jn for qemu-devel@nongnu.org; Mon, 03 Nov 2008 17:03:14 -0500 Message-ID: <490F7519.7090808@web.de> Date: Mon, 03 Nov 2008 23:03:05 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <490B53F0.9040200@codemonkey.ws> <490DFAA2.7040900@web.de> <490F5942.6020100@codemonkey.ws> <490F60E4.1040304@web.de> <490F723E.7070308@web.de> <490F7489.6040403@codemonkey.ws> In-Reply-To: <490F7489.6040403@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC73077FB46D58EBFB8912063" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC73077FB46D58EBFB8912063 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > Jan Kiszka wrote: >> Jan Kiszka wrote: >> =20 >> There is a race between the alarm_timer firing SIGALRM and >> main_loop_wait reaching the safe harbor of select (with that infamous = 5 >> second timeout). If the signal comes when already blocked in select, i= t >> will properly resume the latter immediately. But if the timer fired >> BEFORE that point, host_alarm_handler will only set a flag that the ho= st >> timer has fired, the actual rearming will be done AFTER return from >> select. Ooops.... >> =20 >=20 > Ah, so before this was causing the timer to potentially come 10ms later= > than it should have. I was hoping that this change would shake out thi= s > stuff :-) >=20 >> So, select should actually include the host timer as event. timerfd? >> Unfortunately a recent Linux-only feature :-/. I don't think we can >> rearm the timer from within the signal handler, at least not without >> running all the pending qemu timers. And that is surely not a signal >> handler job (qemu timer handler aren't thread-safe in general). >> >> Anyone any ideas? /me is thinking a bit more about it as well. >> =20 >=20 > host_alarm_handler should write to a file descriptor instead of setting= > a flag. That file descriptor should then be select()'d on (just like w= e > do for SIGUSR2 in block-raw-posix.c). A pipe, that slowly came to my mind as well. OK, will play with it. Jan --------------enigC73077FB46D58EBFB8912063 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.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkkPdR0ACgkQniDOoMHTA+lwCgCfQLtdy81YitghOUtsPr9SYwxg GLwAnilZAnHc2I3xS2UINHN14csRrcym =V7xE -----END PGP SIGNATURE----- --------------enigC73077FB46D58EBFB8912063--