From: Ian Jackson Subject: Re: Re: [Qemu-devel] [PATCH 01/13] Handle terminating signals. Date: Tue, 26 Aug 2008 14:38:52 +0100 Message-ID: <18612.1900.73781.314743@mariner.uk.xensource.com> References: <1219336054-15919-1-git-send-email-kraxel@redhat.com> <1219336054-15919-2-git-send-email-kraxel@redhat.com> <18611.56975.584280.471257@mariner.uk.xensource.com> <48B3F411.2020306@redhat.com> <18611.63711.631859.280983@mariner.uk.xensource.com> <48B4027C.1000008@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <48B4027C.1000008@codemonkey.ws> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Gerd Hoffmann List-Id: xen-devel@lists.xenproject.org Anthony Liguori writes ("[Xen-devel] Re: [Qemu-devel] [PATCH 01/13] Handle terminating signals."): > The race I know of is that you may get an aio signal completion before > select but after you've already qemu_aio_poll()'d. In practice, we only > sleep for 10ms at a time in select() so the race is handled by that. If > we wanted to increase the amount of time we slept, we would have to > handle this race. Yes. And, 10ms is too long anyway for reasonable performance. During my merge with upstream I found that the qemu aio functionality (which was done quite differently to the old xen ioemu) caused a severe performance regression under some conditions because of this race. > In KVM, we sleep for 1s in select() and use signalfd() to receive the > aio notifications. For older hosts, we emulate signalfd using a thread > and the pipe-to-self trick. Why does it need a thread ? You can just write to the pipe in the signal handler. I'll post my code. Ian.