From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeaE3-0000PA-1j for qemu-devel@nongnu.org; Mon, 08 Feb 2010 15:28:55 -0500 Received: from [199.232.76.173] (port=35441 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeaE2-0000Oy-NY for qemu-devel@nongnu.org; Mon, 08 Feb 2010 15:28:54 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeaE1-0001fH-7H for qemu-devel@nongnu.org; Mon, 08 Feb 2010 15:28:54 -0500 Received: from mail-iw0-f185.google.com ([209.85.223.185]:37794) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeaE0-0001f7-Rm for qemu-devel@nongnu.org; Mon, 08 Feb 2010 15:28:53 -0500 Received: by iwn15 with SMTP id 15so4252057iwn.19 for ; Mon, 08 Feb 2010 12:28:52 -0800 (PST) Message-ID: <4B7073FA.8000905@codemonkey.ws> Date: Mon, 08 Feb 2010 14:28:42 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <20100208134645.GA19130@amit-x200.redhat.com> <4B702641.5060907@codemonkey.ws> <20100208173519.GA19993@amit-x200.redhat.com> In-Reply-To: <20100208173519.GA19993@amit-x200.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Slowdowns comparing qemu-kvm.git to qemu.git: vcpu/thread scheduling differences List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Marcelo Tosatti , qemu-devel@nongnu.org, KVM List On 02/08/2010 11:35 AM, Amit Shah wrote: > On (Mon) Feb 08 2010 [08:57:05], Anthony Liguori wrote: > >> On 02/08/2010 07:46 AM, Amit Shah wrote: >> >>> Hello, >>> >>> In my testing of virtio-console, I found qemu-kvm.git introduces a lot >>> of overhead in thread scheduling compared to qemu.git. >>> >>> My test sends a 260M file from the host to a guest via a virtio-console >>> port and then computes the sha1sum of the file on the host as well as on >>> the guest, compares the checksum and declares the result based on the >>> checksum match. The test passes in all the scenarios listed below, >>> indicating there's no unsafe data transfer. >>> >>> >>> Repo Time taken >>> ----- ---------- >>> qemu.git< 1 m (typically 30s) >>> qemu-kvm.git> 16m >>> qemu-iothread ~ 5m >>> >>> >> That very likely suggests that there are missing qemu_notify_events() in >> qemu-kvm.git and you're getting blocked waiting for the next timer event >> to fire. >> > Hm, if that's the case, should virtio_notify() have a call to > qemu_notify_event()? > 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. I'd suggest looking at the main loop in qemu-kvm, seeing what isn't processed as a result of fd becoming readable/writable, and then making sure that any of those mechanisms you're relying on in virtio-console have the appropriate tie-ins to qemu_notify_event(). Regards, Anthony Liguori