From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NevWA-0002Lr-NM for qemu-devel@nongnu.org; Tue, 09 Feb 2010 14:13:02 -0500 Received: from [199.232.76.173] (port=38891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NevW9-0002Lj-0r for qemu-devel@nongnu.org; Tue, 09 Feb 2010 14:13:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NevW7-0000BP-VB for qemu-devel@nongnu.org; Tue, 09 Feb 2010 14:13:01 -0500 Received: from mail2.shareable.org ([80.68.89.115]:35383) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NevW7-0000BB-Lu for qemu-devel@nongnu.org; Tue, 09 Feb 2010 14:12:59 -0500 Date: Tue, 9 Feb 2010 19:12:55 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: Slowdowns comparing qemu-kvm.git to qemu.git: vcpu/thread scheduling differences Message-ID: <20100209191255.GA946@shareable.org> References: <20100208134645.GA19130@amit-x200.redhat.com> <4B702641.5060907@codemonkey.ws> <20100208173519.GA19993@amit-x200.redhat.com> <4B7073FA.8000905@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B7073FA.8000905@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Amit Shah , Marcelo Tosatti , qemu-devel@nongnu.org, KVM List Anthony Liguori wrote: > No, basically, the problem will boil down to, the IO thread is > select()'d waiting for an event to occur. However, you've done > something in the VCPU thread that requires the IO thread to run it's > main loop. You need to use qemu_notify_event() to force the IO thread > to break out of select(). > > Debugging these problems are very difficult and the complexity here is > the main reason the IO thread still hasn't been enabled by default in > qemu.git. It is difficult. One approach to debugging them, in general, is to have a special debugging mode where the select() loop wakes up repeatedly at high speed and checks all the conditions it's supposed to to be waiting for that _should_ have triggered a wakeup, and if any of them are asserted for two timed wakeups (or some sufficient duration, checked by gettimeofday), emit a bug message because it probably is one. I don't know if that could be applied in qemu's event loop. -- Jamie