From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mw0VW-000083-TB for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:26:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mw0VR-0008V0-MF for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:26:42 -0400 Received: from [199.232.76.173] (port=52163 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mw0VR-0008Uk-7i for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:26:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41212) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mw0VQ-0001a9-Nk for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:26:37 -0400 Date: Thu, 8 Oct 2009 23:24:21 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread" Message-ID: <20091008212421.GA7229@redhat.com> References: <20091007132006.GA9668@redhat.com> <4ACCC1A5.5020306@codemonkey.ws> <20091007204421.GC4085@redhat.com> <20091007205523.GA4783@redhat.com> <20091008014742.GA15601@shareable.org> <20091008151527.GB29691@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091008151527.GB29691@shareable.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: qemu-devel@nongnu.org On Thu, Oct 08, 2009 at 04:15:27PM +0100, Jamie Lokier wrote: > malc wrote: > > On Thu, 8 Oct 2009, Jamie Lokier wrote: > > > > > malc wrote: > > > > > The use of sigprocmask() is unspecified in a > > > > > multithreaded process; see pthread_sigmask(3). > > > > > > > > > > Does it matter? > > > > > > > > One of the patches i've asked you to try today replaced sigprocmask with > > > > pthread_sigmask, you've said it did nothing. In any case, strictly > > > > speaking, the code is wrong, so yes it does matter in theory. BTW, tried looking at the code. I saw some (unrelated) issues: static void aio_signal_handler(int signum) { if (posix_aio_state) { char byte = 0; write(posix_aio_state->wfd, &byte, sizeof(byte)); } qemu_service_io(); } And qemu_service_io does a *ton* of things. Questions: - Do we need the call to qemu_service_io? Seems to behave the same with and without it. - Are all of the data structures touched by qemu_service_io protected by blocking signals before access? Also: - let's use signalfd on linux, if available? - for SIGALARM, maybe timerfd? Thanks, -- MST