From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxPQG-0005w5-Vq for qemu-devel@nongnu.org; Tue, 04 Nov 2008 12:10:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxPQF-0005vG-6n for qemu-devel@nongnu.org; Tue, 04 Nov 2008 12:10:32 -0500 Received: from [199.232.76.173] (port=51836 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxPQF-0005v6-29 for qemu-devel@nongnu.org; Tue, 04 Nov 2008 12:10:31 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:59235) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KxPQE-0000qZ-9g for qemu-devel@nongnu.org; Tue, 04 Nov 2008 12:10:31 -0500 Message-ID: <491081EB.5070905@web.de> Date: Tue, 04 Nov 2008 18:10:03 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [5578] Increase default IO timeout from 10ms to 5s References: <49100654.6020108@web.de> <20081104113204.GA32125@shareable.org> <20081104.092231.-1384053398.imp@bsdimp.com> In-Reply-To: <20081104.092231.-1384053398.imp@bsdimp.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDB1E233A8B9696E48AB11EAC" Sender: jan.kiszka@web.de Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "M. Warner Losh" Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDB1E233A8B9696E48AB11EAC Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable M. Warner Losh wrote: > In message: <20081104113204.GA32125@shareable.org> > Jamie Lokier writes: > : andrzej zaborowski wrote: > : > > My man page even warns that the Linux > : > > kernel is not implementing it yet, though I don't think this stil= l > : > > applies to recent 2.6.2x kernels. > : >=20 > : > According to the man page it moved to kernel at 2.6.16 but the glib= c > : > wrapper should be ok too. > :=20 > : If there's a glibc wrapper, it cannot be reliable... > :=20 > : *Looks at glibc source* > :=20 > : That's right. The glibc pselect() wrapper has the same race conditio= n > : which prompted this QEMU bug. If the signal arrives after unmasking > : and before select() in the wrapper, then blocks. > :=20 > : In other words, don't use pselect() if you might run on a kernel olde= r > : than 2.6.16, or on a host architecture which adds pselect() in a late= r > : kernel version. Also, I wouldn't be surprised if older versions of > : some BSDs have similar dodgy wrappers. >=20 > Which ones have a good kernel implementation of it? FreeBSD's is > currently approximately: >=20 > if (!mask) > _sigprocmask(mask, &oldmask); > /* here */ > select(); > if (!mask) > _sigprocmask(oldmask, NULL); >=20 > I'm assuming that the problem is due to a signal arriving at /* here */= =2E I guess those things happen under some kind of preemption lock, otherwise it would be a really poor implementation. However, think we buried the idea of using pselect for this anyway. Jan --------------enigDB1E233A8B9696E48AB11EAC 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 iEYEARECAAYFAkkQge8ACgkQniDOoMHTA+lc6wCdEk8IWv0oNVadRef9CxGJIkBu xkoAnjiM4y0fxeBZh51xPZXUwRDUCAS4 =Mnzg -----END PGP SIGNATURE----- --------------enigDB1E233A8B9696E48AB11EAC--