From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: Slowdowns comparing qemu-kvm.git to qemu.git: vcpu/thread scheduling differences Date: Tue, 9 Feb 2010 19:12:55 +0000 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 Cc: Amit Shah , Marcelo Tosatti , qemu-devel@nongnu.org, KVM List To: Anthony Liguori Return-path: Received: from mail2.shareable.org ([80.68.89.115]:59590 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065Ab0BITNA (ORCPT ); Tue, 9 Feb 2010 14:13:00 -0500 Content-Disposition: inline In-Reply-To: <4B7073FA.8000905@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: 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