From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwYgo-00059t-7t for qemu-devel@nongnu.org; Tue, 30 Mar 2010 06:28:54 -0400 Received: from [140.186.70.92] (port=56844 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwYgk-00059e-SD for qemu-devel@nongnu.org; Tue, 30 Mar 2010 06:28:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwYgi-0001Rl-33 for qemu-devel@nongnu.org; Tue, 30 Mar 2010 06:28:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2903) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwYgh-0001Rg-Qa for qemu-devel@nongnu.org; Tue, 30 Mar 2010 06:28:48 -0400 Message-ID: <4BB1D259.10600@redhat.com> Date: Tue, 30 Mar 2010 13:28:41 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH -V3 09/32] virtio-9p: Implement P9_TWRITE/ Thread model in QEMU References: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1269535420-31206-10-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <4BB04A59.1040204@linux.vnet.ibm.com> <4BB0C09D.7090204@linux.vnet.ibm.com> <4BB10E30.70908@redhat.com> <4BB110B3.8040300@linux.vnet.ibm.com> <4BB118EE.2000703@linux.vnet.ibm.com> In-Reply-To: <4BB118EE.2000703@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jvrao Cc: ericvh@gmail.com, Anthony Liguori , "Aneesh Kumar K.V" , qemu-devel@nongnu.org On 03/30/2010 12:17 AM, jvrao wrote: > > Excuse me for some basic questions..still trying to understand QEMU concepts.. > > How does IO thread is accounted for? > It's just another thread, usually a lightly loaded one. > If I start a 2 CPU QEMU, we will be occupying two physical CPUs with two VCPU threads > and IO thread runs on other CPUs owned by the host right? If the answer is yes, then > we are good as the fileserver load has to be on the host CPUs. > It's completely up to the scheduler and determined by how the iothread, vcpu threads, and other processes on the host are loaded. >> You can dispatch just the system call to a thread pool. The advantage >> of doing that is that you don't need to worry about locking since the >> system calls are not (usually) handling shared state. >> > How is locking avoided in the IO thread model? do we just have 1 IO thread > irrespective of #VCPU threads? Is is that how the locking is avoided? > When you are running qemu code you hold the qemu mutex, except when you are in the thread pool. So the iothread and vcpu threads are all mutually excluded, and defer any blocking work to other threads. > I think IO thread is used to do disk/network IO right? > It's used for completions (disk, network, timers, anything that completes asynchronously to a vcpu). > Putting 9P also on that will have any performance/scalability issues? > Yes. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.