Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAHzP-0001CH-GK for qemu-devel@nongnu.org; Wed, 10 Dec 2008 00:52:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAHzO-0001Br-9G for qemu-devel@nongnu.org; Wed, 10 Dec 2008 00:52:02 -0500 Received: from [199.232.76.173] (port=39724 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAHzN-0001Bm-V1 for qemu-devel@nongnu.org; Wed, 10 Dec 2008 00:52:02 -0500 Received: from nicole.bmts.com ([216.183.128.225]:41025) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAHzN-0006uP-D9 for qemu-devel@nongnu.org; Wed, 10 Dec 2008 00:52:01 -0500 Received: from brennin.fionavar.dd (asy-tiv-ppp300.bmts.com [216.183.149.63]) by nicole.bmts.com (8.13.1/8.13.1) with ESMTP id mBA5pm0c008045 for ; Wed, 10 Dec 2008 00:51:49 -0500 Date: Wed, 10 Dec 2008 00:51:31 -0500 From: Daniel Dickinson Message-ID: <20081210005131.5e4ea956@brennin.fionavar.dd> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/gN_GFhNXwHW5+AB0qtVidub"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Subject: [Qemu-devel] Hanging VM: Fix block I/O hang patch could help? 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" --Sig_/gN_GFhNXwHW5+AB0qtVidub Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, =09 I have been experiencing VM hangs for some time (anything after 0.8.2 on debian) with a Windows 98 SE guest (where I can can consistently hang it by a certain part of the install procedure) as well as various Ubuntu guests (where it will hang but is 'just random'). =46rom Debian bug #474386, quoting myself I have done the bisect and narrowed it down to three commits. Two of the commits do not compile so could be the problem and the third is the first bad commit that does compile. =20 The last good revision is 2072 (git d62ca2669be6d6af2c0cbda47abd7e51548060bf) The first known bad commit is 2075 (git 83f640910acd7cd13ff8a603f29c46033c4fb00) I have attached the diff between these two revisions (three commits worth). The first bad commit is large. It is the switch to asynchronous file I/O for the disk images. I believe the problem is likely a race condition in that code which is unpleasant. The main reason I wonder about this is that if that is the problem I would expect random vm hangs across the board (though possibly rarely) and not just for me. I experience hangs in ubuntu (two versions) as well as windows 98 so that is consistent, ... I have noticed in the user forums some indication that this is happening to other people to. I have also seen the messages series titled Re: [Qemu-devel] [patch] Fix block I/O hang. and was wondering if that could be the problem. I include the last message in that series below. Re: [Qemu-devel] [patch] Fix block I/O hang. From: Gerd Hoffmann Subject: Re: [Qemu-devel] [patch] Fix block I/O hang. Date: Thu, 13 Nov 2008 10:14:31 +0100 User-agent: Thunderbird 2.0.0.16 (X11/20080723) Anthony Liguori wrote: > Gerd Hoffmann wrote: >> =20 >>> Under what circumstances? posix_aio_read() is only invoked from a >>> select callback. This means there should be data available to be read. >>> =20 >> >> Well, there are *two* select loops: main_loop_wait() and >> qemu_aio_wait(). Calling sync block i/o functions from a i/o handler >> causes the two select loops run nested =3D> boom. >=20 > Yeah, qemu_aio_wait needs to die. Can you resubmit your patch with a > better description, and change the read() look in posix_aio_read() to > consume as much data as possible before hitting EAGAIN? I've fixed my problem by changing xen_disk to use a bottom half for actual work, so the block read/write calls are moved out of the select loop anyway. Which turned out to be useful for aio support too. So I'm fine again with the current state. I can create such a patch nevertheless though. cheers, Gerd If this isn't xen-specific I'd like to try a build with this patch to see if it works. Regards, Daniel --=20 And that's my crabbing done for the day. Got it out of the way early,=20 now I have the rest of the afternoon to sniff fragrant tea-roses or=20 strangle cute bunnies or something. -- Michael Devore GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C http://gnupg.org The C Shore: http://www.wightman.ca/~cshore --Sig_/gN_GFhNXwHW5+AB0qtVidub Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkk/WOMACgkQhvWBpdQuHxyEIQCdHgWQ7U1W/JvlJyMvof7Er4jj mSkAn3eVptlGpydNhXNxb3FGp8hR6ai2 =+aLa -----END PGP SIGNATURE----- --Sig_/gN_GFhNXwHW5+AB0qtVidub--