From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvVCC-0006WY-Rh for qemu-devel@nongnu.org; Mon, 22 Aug 2011 10:09:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvVC8-0004Kc-Em for qemu-devel@nongnu.org; Mon, 22 Aug 2011 10:09:44 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:55465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvVC8-0004KP-B9 for qemu-devel@nongnu.org; Mon, 22 Aug 2011 10:09:40 -0400 Received: by gwb19 with SMTP id 19so3582678gwb.4 for ; Mon, 22 Aug 2011 07:09:39 -0700 (PDT) Message-ID: <4E52631D.8060609@codemonkey.ws> Date: Mon, 22 Aug 2011 09:09:33 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1314019498-8550-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] main: force enabling of I/O thread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , Jan Kiszka , qemu-devel@nongnu.org, Blue Swirl , Paolo Bonzini , Aurelien Jarno On 08/22/2011 08:50 AM, Peter Maydell wrote: > On 22 August 2011 14:24, Anthony Liguori wrote: >> Enabling the I/O thread by default seems like an important part of declaring >> 1.0. Besides allowing true SMP support with KVM, the I/O thread means that the >> TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which >> currently requires a (racey) signal based alarm system. > > Even with iothread it's still signal based (and still racy) -- the only way > to get a thread currently executing TCG code to stop doing so is to send it > a signal. What I meant is that we use SIGALRM to effectively do preemptive multiple tasking between the VCPU thread and the I/O thread. We still need to use signals with the I/O thread because we run the two in lock step. The race I was referring to with SIGALRM has to do with a guest disabling timer interrupts and any other event source. It'll cause a live lock in TCG. The only way to fix this is by moving to the I/O thread or setting SIGIO on every fd. Since every fd doesn't support SIGIO, I/O thread is really the only correct solution. Regards, Anthony Liguori > > -- PMM >