From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58940 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmmZL-00064a-Np for qemu-devel@nongnu.org; Tue, 08 Feb 2011 07:21:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmmZK-0002ST-FI for qemu-devel@nongnu.org; Tue, 08 Feb 2011 07:21:19 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:65005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmmZK-0002SE-Ad for qemu-devel@nongnu.org; Tue, 08 Feb 2011 07:21:18 -0500 Received: by wwi18 with SMTP id 18so5555324wwi.10 for ; Tue, 08 Feb 2011 04:21:17 -0800 (PST) Message-ID: <4D51979F.8080105@codemonkey.ws> Date: Tue, 08 Feb 2011 13:21:03 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 2/7] Enable I/O thread and VNC threads by default References: <20110208072657.GD16429@hall.aurel32.net> <4D50FA14.5010100@redhat.com> <4D5103E8.6050808@siemens.com> <4D510771.3040309@aurel32.net> <4D511221.9030505@siemens.com> <4D5113D3.9090802@aurel32.net> <4D511500.1040303@siemens.com> <4D5115C2.6060008@aurel32.net> <4D51842C.8000209@codemonkey.ws> <20110208114618.GF16429@hall.aurel32.net> In-Reply-To: <20110208114618.GF16429@hall.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Tristan Gingold , Stefan Hajnoczi , Jan Kiszka , Marcelo Tosatti , "qemu-devel@nongnu.org" , Anthony Liguori , Paul Brook , Paolo Bonzini , "Edgar E. Iglesias" , Arun Bharadwaj On 02/08/2011 05:46 AM, Aurelien Jarno wrote: > On Tue, Feb 08, 2011 at 12:07:02PM +0100, Tristan Gingold wrote: > >> On Feb 8, 2011, at 6:58 PM, Anthony Liguori wrote: >> >> >>> On 02/08/2011 04:06 AM, Aurelien Jarno wrote: >>> >>>> Yes, it's slow. But is it a problem? You assume that people use QEMU >>>> only for emulating SMP platforms. This is a wrong assumption. Beside the >>>> x86 target, only sparc really supports SMP emulation. >>>> >>>> >>> It's *not* just about performance. >>> >>> TCG requires a signal to break out of a tight chained TB loop. If you have a guest in a tight loop waiting for something external (like polling on a in-memory flag), the device emulation will not get to run until a signal is fired. >>> >>> Unless you set SIGIO on every file descriptor that selects polls on (and you can't because there are a number that just don't support SIGIO), then you have a race condition. >>> >> A race condition ? Looks like you are describing a dead-lock. >> >> But the dead lock doesn't happen because of the timer which periodically exits from TCG. Hence the performance issue. >> With dynticks, you don't always have a periodic timer (unless the guest has a periodic timer enabled). There's a good bit of early startup code that runs without a periodic timer enabled. Now that said, we never truly sleep forever. We'll set something like a 5 second timeout. But 5 seconds might as well be forever and this is certainly a giant hack. Regards, Anthony Liguori >>> This can be fixed by running TCG in a separate thread than select() and sending a signal to the TCG VCPU when select() returns (effectively SIGIO in userspace). >>> >>> This is exactly what the I/O thread does. >>> >> >> (Nobody was able to make it working on Windows - or nobody was interested in ?) >> >> > Given the I/O thread is disabled by default, my guess is that nobody > really see an interest in looking at that. > >