From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOtA0-0007rF-Tm for qemu-devel@nongnu.org; Fri, 01 Aug 2008 07:51:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOt9x-0007kb-Iv for qemu-devel@nongnu.org; Fri, 01 Aug 2008 07:51:04 -0400 Received: from [199.232.76.173] (port=49339 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOt9x-0007kE-6d for qemu-devel@nongnu.org; Fri, 01 Aug 2008 07:51:01 -0400 Received: from sj-iport-6.cisco.com ([171.71.176.117]:47980) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1KOt9w-0000a5-B8 for qemu-devel@nongnu.org; Fri, 01 Aug 2008 07:51:01 -0400 Message-ID: <4892F896.4040006@cisco.com> Date: Fri, 01 Aug 2008 05:50:46 -0600 From: "David S. Ahern" MIME-Version: 1.0 References: <4891DF28.6040908@cisco.com> <4891E230.8090109@codemonkey.ws> In-Reply-To: <4891E230.8090109@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: scheduling of qemu threads Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > David S. Ahern wrote: >> Last week or so Anthony made a comment about qemu basically being single >> threaded given its global mutex. What are the impacts to simultaneous >> scheduling of qemu threads? As I understand it, qemu has a main thread, >> a monitor thread, an IO thread and a thread for each vcpu. Can 2 or more >> vcpu threads run concurrently? Can a vcpu thread and an IO thread run >> concurrently? Does kvm alter the concurrency? >> > > All threads run in lock-step except when a VCPU is running (via > kvm_run). So a VCPU can run while the IO thread is active. Only one > VCPU can execute IO at a given time though. Not to be dense, but do you mean yes 2 or more vcpu threads can be run at the same time? I ask because it does not make sense for them not to be performance wise, but at the same time following the code from kvm_main_loop_cpu() to kvm_run() I do not see the qemu_mutex unlocked before the ioctl(). I only see it unlocked in kvm_main_loop_wait(). thanks, david > > Regards, > > Anthony Liguori > >> david >> > >